mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1665 Handle end of file without error when parsing command file
This commit is contained in:
@@ -69,6 +69,12 @@ std::vector<RicfCommandObject*> RicfCommandFileReader::readCommands(QTextStream&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (commandName.isEmpty() && inputStream.atEnd())
|
||||||
|
{
|
||||||
|
// Read past the last command
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
CAF_ASSERT(objectFactory);
|
CAF_ASSERT(objectFactory);
|
||||||
caf::PdmObjectHandle* obj = objectFactory->create(commandName);
|
caf::PdmObjectHandle* obj = objectFactory->create(commandName);
|
||||||
RicfCommandObject* cObj = dynamic_cast<RicfCommandObject*>(obj);
|
RicfCommandObject* cObj = dynamic_cast<RicfCommandObject*>(obj);
|
||||||
|
|||||||
@@ -59,11 +59,12 @@ void RicfCommandFileExecutor::executeCommands(QTextStream& stream)
|
|||||||
{
|
{
|
||||||
if (message.first == RicfMessages::MESSAGE_WARNING)
|
if (message.first == RicfMessages::MESSAGE_WARNING)
|
||||||
{
|
{
|
||||||
RiaLogging::warning(message.second);
|
RiaLogging::warning(QString("Command file parsing warning: %1").arg(message.second));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RiaLogging::error(message.second);
|
RiaLogging::error(QString("Command file parsing error: %1").arg(message.second));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (RicfCommandObject* command : commands)
|
for (RicfCommandObject* command : commands)
|
||||||
|
|||||||
Reference in New Issue
Block a user