Commit 732e00f9 authored by Isaak Lim's avatar Isaak Lim

null pointer check for getObject in datacontrol and selection plugin

parent b605a147
Pipeline #280 passed with stage
......@@ -390,14 +390,15 @@ void DataControlPlugin::fileOpened(int _id){
BaseObject* obj = 0;
if ( PluginFunctions::getObject(_id, obj) )
if ( PluginFunctions::getObject(_id, obj) ) {
model_->objectAdded(obj);
// Only if the added object was a light source, we will traverse the objects!
if ( obj->dataType() == DATA_LIGHT)
slotShowLightSources(tool_->lightSources->checkState());
// Only if the added object was a light source, we will traverse the objects!
if ( obj->dataType() == DATA_LIGHT)
slotShowLightSources(tool_->lightSources->checkState());
view_->resizeColumnToContents(0);
view_->resizeColumnToContents(0);
}
}
......
......@@ -1547,7 +1547,7 @@ void SelectionBasePlugin::addedEmptyObject (int _id) {
PluginFunctions::getObject(_id, bObject);
// Groups are ok, others will cause an error
if (!bObject->isGroup()) {
if (bObject && !bObject->isGroup()) {
emit log(LOGERR, "Could not retrieve object type! Maybe a selection environment will be missing.");
}
......
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