From e242f548166fa93f96c537a0ff6d462f043febe7 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 2 Oct 2023 22:12:07 +0100 Subject: [PATCH] Fix crash trying to create a new board. --- pcbnew/files.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 174c88e7ff..b10ee3b8bd 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -549,7 +549,10 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in // No save prompt (we already prompted above), and only reset to a new blank board if new Clear_Pcb( false, !is_new ); - IO_MGR::PCB_FILE_T pluginType = IO_MGR::FindPluginTypeFromBoardPath( fullFileName, aCtl ); + IO_MGR::PCB_FILE_T pluginType = IO_MGR::KICAD_SEXP; + + if( !is_new ) + pluginType = IO_MGR::FindPluginTypeFromBoardPath( fullFileName, aCtl ); if( pluginType == IO_MGR::FILE_TYPE_NONE ) return false;