Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Fix Select keyframes hotkey crash

manongjohnf168fbc5c900
diff --git a/toonz/sources/toonz/xsheetcmd.cpp b/toonz/sources/toonz/xsheetcmd.cpp
index 32673fc7e..1f36899ed 100644
--- a/toonz/sources/toonz/xsheetcmd.cpp
+++ b/toonz/sources/toonz/xsheetcmd.cpp
@@ -829,7 +829,8 @@ public:
TApp *app = TApp::instance();
TKeyframeSelection *selection = dynamic_cast<TKeyframeSelection *>(
app->getCurrentSelection()->getSelection());
- int row = app->getCurrentFrame()->getFrame();
+ if (!selection) return;
+ int row = app->getCurrentFrame()->getFrame();
selection->selectNone();
ToonzScene *scene = app->getCurrentScene()->getScene();
@@ -862,7 +863,7 @@ public:
TApp *app = TApp::instance();
TKeyframeSelection *selection = dynamic_cast<TKeyframeSelection *>(
app->getCurrentSelection()->getSelection());
-
+ if (!selection) return;
int col = app->getCurrentColumn()->getColumnIndex();
TStageObjectId objectId = app->getCurrentObject()->getObjectId();
if (app->getCurrentObject()->getObjectId() == TStageObjectId::CameraId(0)) {