Skip to content

Commit 45f0df6

Browse files
committed
Fix crash when compiling with 'OFXVP_BUILD_WITH_MINIMAL_OBJECTS'
1 parent f68c609 commit 45f0df6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/ofxVisualProgramming.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,18 @@ void ofxVisualProgramming::addObject(string name,ofVec2f pos){
660660

661661
shared_ptr<PatchObject> tempObj = selectObject(name);
662662

663+
// selectObject can return nullptr !
664+
if( tempObj.get() == nullptr ){
665+
ofLogWarning("ofxVisualProgramming::addObject") << "The requested object « " << name << " » is not available !"
666+
#ifdef OFXVP_BUILD_WITH_MINIMAL_OBJECTS
667+
<< "\n(note: ofxVisualProgramming is compiling with OFXVP_BUILD_WITH_MINIMAL_OBJECTS enabled.)";
668+
#else
669+
;
670+
#endif
671+
bLoadingNewObject = false;
672+
return;
673+
}
674+
663675
tempObj->newObject();
664676
tempObj->setPatchfile(currentPatchFile);
665677
tempObj->setup(mainWindow);

0 commit comments

Comments
 (0)