From 6c7616de1b639ff6c2f1a2337c5fe1417cf9d2bb Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Tue, 18 Oct 2022 13:37:09 +0200 Subject: [PATCH] McuSupport: Avoid accessing invalid pointer After the options dialog has been closed, all widgets are deleted but the m_fileChooser will not be set to nullptr again. Avoiding to use the widgets for data based accesses. Change-Id: I5d99fc4a34ecd9d22e26854c6956e9c0116de94b Reviewed-by: Reviewed-by: Christian Stenger --- src/plugins/mcusupport/mcupackage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/mcusupport/mcupackage.cpp b/src/plugins/mcusupport/mcupackage.cpp index 2b03a696c19..67b5f2091a1 100644 --- a/src/plugins/mcusupport/mcupackage.cpp +++ b/src/plugins/mcusupport/mcupackage.cpp @@ -93,7 +93,7 @@ const McuPackageVersionDetector *McuPackage::getVersionDetector() const FilePath McuPackage::basePath() const { - return m_fileChooser != nullptr ? m_fileChooser->filePath() : m_path; + return m_path; } FilePath McuPackage::path() const