Use dynamic_cast for safety in eeconfig()

Calling config() gets you whatever APP_SETTINGS_BASE is returned
by the underlying kiface, which is currently going to be an
EESCHEMA_SETTINGS everywhere this is used, but that isn't a
guarantee.
This commit is contained in:
Jon Evans 2020-05-10 18:43:01 -04:00
parent 108cf23892
commit 0d654b3574
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ public:
SCH_SCREEN* GetScreen() const override;
void SetScreen( BASE_SCREEN* aScreen ) override;
EESCHEMA_SETTINGS* eeconfig() const { return static_cast<EESCHEMA_SETTINGS*>( config() ); }
EESCHEMA_SETTINGS* eeconfig() const { return dynamic_cast<EESCHEMA_SETTINGS*>( config() ); }
void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;