From a1f25ceb7f8a8319dc4584e32d9c38bec892d6ca Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Wed, 26 Oct 2016 19:06:41 +0200 Subject: [PATCH] Fix bug in input box handling. Should fix #9095. --- UI/NativeApp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 543153bb5c..32203d9efc 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -762,10 +762,11 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) { } if (msg == "inputbox_completed") { SplitString(value, ':', inputboxValue); + std::string setString = inputboxValue.size() > 1 ? inputboxValue[1] : ""; if (inputboxValue[0] == "IP") - g_Config.proAdhocServer = inputboxValue[1]; + g_Config.proAdhocServer = setString; if (inputboxValue[0] == "nickname") - g_Config.sNickName = inputboxValue[1]; + g_Config.sNickName = setString; inputboxValue.clear(); } if (msg == "savestate_displayslot") {