From 8efd3642bc53e1db7ab1a34bd4c6a5a9a105d71b Mon Sep 17 00:00:00 2001 From: Cirilo Bernardo Date: Mon, 25 Jan 2016 17:10:08 +1100 Subject: [PATCH] Fixed bug which allowed empty filenames to be added to the model list --- pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp | 2 +- pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp index a12f4c1395..fcf33b5f83 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp +++ b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp @@ -568,7 +568,7 @@ void DIALOG_MODULE_BOARD_EDITOR::BrowseAndAdd3DShapeFile() } if( !S3D::Select3DModel( this, Prj().Get3DCacheManager(), - initialpath, filter, &model ) ) + initialpath, filter, &model ) || model.filename.empty() ) { return; } diff --git a/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp b/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp index fe72ebec54..b16f3f82bb 100644 --- a/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp +++ b/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp @@ -435,7 +435,7 @@ void DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DShapeFile() } if( !S3D::Select3DModel( m_PreviewPane, Prj().Get3DCacheManager(), - initialpath, filter, &model ) ) + initialpath, filter, &model ) || model.filename.empty() ) { return; }