diff --git a/ReflexToQ3/includes/EntityConverter.cpp b/ReflexToQ3/includes/EntityConverter.cpp index 55b8bea..709c939 100644 --- a/ReflexToQ3/includes/EntityConverter.cpp +++ b/ReflexToQ3/includes/EntityConverter.cpp @@ -412,6 +412,7 @@ EntityConverter::convertTarget(std::vector &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 &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; }