File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -412,8 +412,8 @@ QString QgsApplication::iconPath( const QString& iconFile )
412
412
413
413
QIcon QgsApplication::getThemeIcon ( const QString &theName )
414
414
{
415
- QgsApplication* app = static_cast <QgsApplication*>( instance () );
416
- if ( app->mIconCache .contains ( theName ) )
415
+ QgsApplication* app = qobject_cast <QgsApplication*>( instance () );
416
+ if ( app && app ->mIconCache .contains ( theName ) )
417
417
return app->mIconCache .value ( theName );
418
418
419
419
QIcon icon;
@@ -435,7 +435,8 @@ QIcon QgsApplication::getThemeIcon( const QString &theName )
435
435
icon = QIcon ();
436
436
}
437
437
438
- app->mIconCache .insert ( theName, icon );
438
+ if ( app )
439
+ app->mIconCache .insert ( theName, icon );
439
440
return icon;
440
441
}
441
442
You can’t perform that action at this time.
0 commit comments