diff --git a/system/jlib/jsocket.cpp b/system/jlib/jsocket.cpp index 9f4bb2d6b72..e5ce4770c47 100644 --- a/system/jlib/jsocket.cpp +++ b/system/jlib/jsocket.cpp @@ -6380,15 +6380,19 @@ StringBuffer &SocketEndpointArray::getText(StringBuffer &text) const return item(0).getEndpointHostText(text); byte lastip[4]; const SocketEndpoint &first = item(0); - bool lastis4 = first.getNetAddress(sizeof(lastip),&lastip)==sizeof(lastip); - unsigned short lastport = first.port; first.getHostText(text); + bool lastis4 = false; + if (!first.queryHostname()) + lastis4 = first.getNetAddress(sizeof(lastip),&lastip)==sizeof(lastip); + unsigned short lastport = first.port; unsigned rep=0; unsigned range=0; for (unsigned i=1;i