Skip to content

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

C

fix crash on adjust current level to this palette

shun-iwasawa35e0cc91bda2
diff --git a/toonz/sources/toonzqt/studiopaletteviewer.cpp b/toonz/sources/toonzqt/studiopaletteviewer.cpp
index 2d88c0537..dc19621f9 100644
--- a/toonz/sources/toonzqt/studiopaletteviewer.cpp
+++ b/toonz/sources/toonzqt/studiopaletteviewer.cpp
@@ -714,6 +714,9 @@ void StudioPaletteTreeViewer::loadInCurrentPaletteAndAdaptLevel() {
TPalette *palette = m_levelPaletteHandle->getPalette();
if (!palette) return;
+ // prevent crash when the command is applied to the palette level
+ if (!m_currentLevelHandle->getSimpleLevel()) return;
+
TPalette *newPalette =
StudioPalette::instance()->getPalette(getItemPath(items[0]), true);
if (!newPalette) return;