From 55724928ddbf122ac17e5aab1760d6401dd8825a Mon Sep 17 00:00:00 2001 From: shenleban tongying Date: Mon, 30 Sep 2024 16:44:00 -0400 Subject: [PATCH] fix: init icon size is not normal due to missing null check --- src/config.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config.cc b/src/config.cc index 045d8130a..32df08b4b 100644 --- a/src/config.cc +++ b/src/config.cc @@ -1157,8 +1157,9 @@ Class load() c.showingDictBarNames = ( root.namedItem( "showingDictBarNames" ).toElement().text() == "1" ); - c.usingToolbarsIconSize = - ( static_cast< ToolbarsIconSize >( root.namedItem( "usingToolbarsIconSize" ).toElement().text().toInt() ) ); + if ( auto usingToolbarsIconSize = root.namedItem( "usingToolbarsIconSize" ); !usingToolbarsIconSize.isNull() ) { + c.usingToolbarsIconSize = static_cast< ToolbarsIconSize >( usingToolbarsIconSize.toElement().text().toInt() ); + } if ( !root.namedItem( "historyExportPath" ).isNull() ) c.historyExportPath = root.namedItem( "historyExportPath" ).toElement().text();