Skip to content

Commit

Permalink
fix: init icon size is not normal due to missing null check
Browse files Browse the repository at this point in the history
  • Loading branch information
shenlebantongying committed Sep 30, 2024
1 parent 4a0124d commit 5572492
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5572492

Please sign in to comment.