From 35e0cc91bda2435d04f847fbf165edb4a5e970ee Mon Sep 17 00:00:00 2001 From: shun-iwasawa Date: Jan 11 2020 19:22:05 +0000 Subject: fix crash on adjust current level to this palette --- diff --git a/toonz/sources/toonzqt/studiopaletteviewer.cpp b/toonz/sources/toonzqt/studiopaletteviewer.cpp index 2d88c05..dc19621 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;