changeset 236:69b031cc8064

Check for sargs.length >= 1.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 10 Sep 2018 08:10:11 +0300
parents 2e772a17a4ed
children a3f79ce74471
files mpui.js
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mpui.js	Thu Sep 06 15:42:31 2018 +0300
+++ b/mpui.js	Mon Sep 10 08:10:11 2018 +0300
@@ -303,9 +303,11 @@
   {
     var sargs = unescape(slink.substr(spos + 1)).split(":");
     mpURL = slink.substr(0, spos);
-    mpMachine = parseInt(sargs[0]);
     found = true;
 
+    if (sargs.length >= 1)
+      mpMachine = parseInt(sargs[0]);
+
     if (sargs.length >= 3)
     {
       mpUIForcedWidth = parseInt(sargs[1]);