From 54cfb62597c80f6b5688ad109c3ca94263789e91 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 3 Jul 2025 17:35:34 -0600 Subject: [PATCH] Double check file dlg results on MSW. --- kicad/tools/kicad_manager_control.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kicad/tools/kicad_manager_control.cpp b/kicad/tools/kicad_manager_control.cpp index bb10b99027..a634dd71cc 100644 --- a/kicad/tools/kicad_manager_control.cpp +++ b/kicad/tools/kicad_manager_control.cpp @@ -409,8 +409,13 @@ int KICAD_MANAGER_CONTROL::openProject( const wxString& aDefaultDir ) if( !pro.IsAbsolute() ) pro.MakeAbsolute(); - if( !pro.FileExists() ) + // You'd think wxFD_FILE_MUST_EXIST and the wild-cards would enforce these. Sentry + // indicates otherwise (at least on MSW). + if( !pro.Exists() || ( pro.GetExt() != FILEEXT::ProjectFileExtension + && pro.GetExt() != FILEEXT::LegacyProjectFileExtension ) ) + { return -1; + } m_frame->LoadProject( pro );