From b5dd396b498e8a1106bccb6bf63a4b2e31698b3d Mon Sep 17 00:00:00 2001 From: manongjohn Date: Mar 19 2019 02:05:31 +0000 Subject: Fix toonz raster brush style update crash (#2517) --- diff --git a/toonz/sources/tnztools/toonzrasterbrushtool.cpp b/toonz/sources/tnztools/toonzrasterbrushtool.cpp index b632221..3bf9d7d 100644 --- a/toonz/sources/tnztools/toonzrasterbrushtool.cpp +++ b/toonz/sources/tnztools/toonzrasterbrushtool.cpp @@ -2081,6 +2081,11 @@ void ToonzRasterBrushTool::updateCurrentStyle() { TTool::Application *app = TTool::getApplication(); TMyPaintBrushStyle *brushStyle = dynamic_cast(app->getCurrentLevelStyle()); + if (!brushStyle) { + // brush changed to normal abnormally. Complete color style change. + onColorStyleChanged(); + return; + } double radiusLog = brushStyle->getBrush().getBaseValue( MYPAINT_BRUSH_SETTING_RADIUS_LOGARITHMIC) + m_modifierSize.getValue() * log(2.0);