don't call functions on nullptr
This commit is contained in:
@@ -19,10 +19,15 @@ void MinimalApp::run() {
|
||||
toClose.clear();
|
||||
|
||||
for(auto m : toOpen) {
|
||||
static Archimedes::Module* n;
|
||||
if(std::holds_alternative<std::string>(m)) {
|
||||
load(std::get<std::string>(m))->onLoad();
|
||||
n = load(std::get<std::string>(m));
|
||||
} else {
|
||||
load(std::get<Archimedes::Module*>(m))->onLoad();
|
||||
n = load(std::get<Archimedes::Module*>(m));
|
||||
}
|
||||
if(n) {
|
||||
n->onLoad();
|
||||
n = nullptr;
|
||||
}
|
||||
}
|
||||
toOpen.clear();
|
||||
|
||||
Reference in New Issue
Block a user