Fix a crash when trying to show an error with bad separator.

For example, a single dot or colon at the end of the error string.
pull/561/head
Roc 2020-03-13 00:03:26 +01:00 committed by GitHub
parent 6017ecdacc
commit a6c34bb44d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -138,9 +138,11 @@ static void MessageBox(const char *fmt, va_list va, bool error,
}
}
if(description.length() > 0) {
std::string::iterator it = description.begin();
while(isspace(*it)) it++;
description = description.substr(it - description.begin());
}
Platform::MessageDialogRef dialog = CreateMessageDialog(SS.GW.window);
if (!dialog) {