From a0da252a6a641c98986ad34acae57053034bc2e2 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 13 Aug 2021 11:15:12 +0200 Subject: [PATCH] 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. --- common/settings/settings_manager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/settings/settings_manager.cpp b/common/settings/settings_manager.cpp index e8c41c61ef..7eb71b65af 100644 --- a/common/settings/settings_manager.cpp +++ b/common/settings/settings_manager.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2020 Jon Evans - * 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; }