Browse Source

Small fix on serverlist

Mihawk 12 years ago
parent
commit
00f90c4751
1 changed files with 14 additions and 3 deletions
  1. 14 3
      Settings.cpp

+ 14 - 3
Settings.cpp

@@ -75,9 +75,20 @@ Settings::ServerList Settings::serverList()
     ourSettings->setArrayIndex(i);
     QStringList svaddr = ourSettings->value("address").toString().split(":");
     Server sv;
-    sv.address = svaddr.at(0);
-    sv.port = svaddr.at(1).toUShort();
-    sv.supportsSendPrivate = svaddr.at(2).toInt();
+    if(svaddr.size() == 3)
+    {
+      sv.address = svaddr.at(0);
+      sv.port = svaddr.at(1).toUShort();
+      sv.supportsSendPrivate = svaddr.at(2).toInt();
+    }
+    else if(svaddr.size() == 2)
+    {
+      sv.address = svaddr.at(0);
+      sv.port = svaddr.at(1).toUShort();
+      sv.supportsSendPrivate = false;
+    }
+    else
+      continue;
     list.append(sv);
   }
   ourSettings->endArray();