Commit e5f26be7 authored by Jan Möbius's avatar Jan Möbius

Dont crash when we get a wrog id after adding a new object

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12241 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 5501e0b2
......@@ -258,10 +258,16 @@ int Core::loadObject ( QString _filename ) {
// Get the object to figure out the data type
BaseObject* object;
PluginFunctions::getObject(id,object);
// Add to recent files with the given datatype
if ( OpenFlipper::Options::gui() )
coreWidget_->addRecent(_filename, object->dataType());
// Security check, if object really exists
if ( object != 0 ) {
// Add to recent files with the given datatype
if ( OpenFlipper::Options::gui() )
coreWidget_->addRecent(_filename, object->dataType());
} else {
emit log(LOGERR, tr("Unable to add recent as object with id %1 could not be found!").arg(id) );
}
} else
coreWidget_->statusMessage( tr("Loading %1 ... failed!").arg(_filename), 4000 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment