Browse Source

example-multipleServers-pretty now shows an error when no servers are available

dosse91 4 years ago
parent
commit
a3b20ba316
1 changed files with 6 additions and 2 deletions
  1. 6 2
      example-multipleServers-pretty.html

+ 6 - 2
example-multipleServers-pretty.html

@@ -48,8 +48,12 @@ s.onend=function(aborted){ //callback for test ended/aborted
 }
 function selectServer(){ //called after loading server list
     s.selectServer(function(server){ //run server selection. When the server has been selected, display it in the UI
-        I("startStopBtn").style.display=""; //show start/stop button again
-        I("serverId").textContent=server.name; //show name of test server
+        if(server==null){
+            I("serverId").textContent="No servers available";
+        }else{
+            I("startStopBtn").style.display=""; //show start/stop button again
+            I("serverId").textContent=server.name; //show name of test server
+        }
     });
 }
 function loadServers(){ //called when the page is fully loaded