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:
parent
766b67a8f1
commit
a0da252a6a
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* 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 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
|
* 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
|
* 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
|
PROJECT& SETTINGS_MANAGER::Prj() const
|
||||||
{
|
{
|
||||||
// No MDI yet: First project in the list is the active project
|
// 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;
|
return *m_projects.begin()->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue