Fixed potential OOS

This commit is contained in:
mathusummut
2018-09-27 00:13:16 +02:00
parent d8e2bfa263
commit 2ad935481e

View File

@@ -427,8 +427,10 @@ namespace
const Unit * targetUnit,
bool tryQueue,
int unitCommandGroupId, bool isMove) const {
std::pair < CommandResult, string > result(crFailUndefined, "");
if (this->pauseNetworkCommands == true) {
return std::pair < CommandResult, string >(crFailUndefined, "");
return result;
}
if (SystemFlags::getSystemSettingType(SystemFlags::debugSystem).
@@ -438,8 +440,6 @@ namespace
extractFileFromDirectoryPath(__FILE__).
c_str(), __FUNCTION__, __LINE__);
std::pair < CommandResult, string > result(crFailUndefined, "");
if (selection->isEmpty() == false) {
Vec2i
refPos,
@@ -684,7 +684,7 @@ namespace
}
/*throw
megaglest_runtime_error(szBuf);*/
return result;
return std::pair<CommandResult, string>(crFailUndefined, "");
}
}