Fix crash on "no level" selected in level strip. (#149)

* Fix crash on no level selected in level strip.

* test triggering builds

* trigger again

* and again
This commit is contained in:
Jeremy Bullock 2020-09-10 11:38:41 -06:00 committed by GitHub
parent 44659103e9
commit dc7abf6de4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -310,7 +310,12 @@ void FullColorBrushTool::leftButtonDown(const TPointD &pos,
TTool::Application *app = TTool::getApplication();
if (!app) return;
TXshLevel *level = app->getCurrentLevel()->getLevel();
TXshLevel *level = app->getCurrentLevel()->getLevel();
if (level == NULL) {
m_active = false;
return;
}
TXshSimpleLevelP simLevel = level->getSimpleLevel();
m_assistantPoints = simLevel->getProperties()->getVanishingPoints();

View file

@ -1246,10 +1246,14 @@ void ToonzRasterBrushTool::leftButtonDown(const TPointD &pos,
}
}
TXshLevel *level = app->getCurrentLevel()->getLevel();
TXshLevel *level = app->getCurrentLevel()->getLevel();
if (level == NULL) {
m_active = false;
return;
}
TXshSimpleLevelP simLevel = level->getSimpleLevel();
m_assistantPoints = simLevel->getProperties()->getVanishingPoints();
m_assistantPoints = simLevel->getProperties()->getVanishingPoints();
if (e.isAltPressed() && e.isCtrlPressed() && !e.isShiftPressed()) {
m_addingAssistant = true;
bool deletedPoint = false;