Skip to content

Commit

Permalink
fix dbug crashes on 3rd party modules
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeallisonJS committed Aug 30, 2020
1 parent 5aec520 commit 539e168
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/DBug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ bool DBugDisplay::isConnected() {

bool DBugDisplay::isSafe() {
// TODO: Better bad parent module testing. Sadly, model pointer slug & id do not dereference properly
// At least test that dbug isn't being nested
return module->leftExpander.module->model != modelDBug;
auto leftExpanderModule = module->leftExpander.module;
bool notNested = leftExpanderModule->model != modelDBug;
bool isDBugable = dynamic_cast<CSModule*>(leftExpanderModule) != nullptr;
return notNested && isDBugable;
}

Model* modelDBug = createModel<DBug, DBugWidget>("DBug");

0 comments on commit 539e168

Please sign in to comment.