SETTINGS_MANAGER::Prj(): add a wxASSERT to allow python script debug before a crash

Due to a bug, SETTINGS_MANAGER::Prj() returns a null PROJECT when running a
python script from the python console. this wxASSERT helps debugging.
This commit is contained in:
jean-pierre charras 2021-08-13 11:15:12 +02:00
parent 766b67a8f1
commit a0da252a6a
1 changed files with 2 additions and 1 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -859,6 +859,7 @@ bool SETTINGS_MANAGER::UnloadProject( PROJECT* aProject, bool aSave )
PROJECT& SETTINGS_MANAGER::Prj() const
{
// No MDI yet: First project in the list is the active project
wxASSERT_MSG( m_projects.size(), "no project in list" );
return *m_projects.begin()->second;
}