EntityConverter::convertTarget made safer

This commit is contained in:
suhrke 2017-07-03 19:27:18 -07:00
parent 0b6254da89
commit 991cb4d02a

View File

@ -412,6 +412,7 @@ EntityConverter::convertTarget(std::vector<std::string> &lines)
bool haveName = false;
bool haveAngle = false;
if ( lines.size() < 3 ) {
throw std::runtime_error("error: Target entity requires at least 3 lines");
}
@ -469,9 +470,12 @@ EntityConverter::convertTarget(std::vector<std::string> &lines)
oss3 << "\"angle\" \"" << angle << "\"\n";
convertedLines.push_back (oss3.str() );
}
return convertedLines;
}
else {
throw std::runtime_error("error: Target entity requires position coordinates and targetname");
}
return convertedLines;
}