diff --git a/pcbnew/import_gfx/dxf_import_plugin.cpp b/pcbnew/import_gfx/dxf_import_plugin.cpp index ce9ff76f96..287509327f 100644 --- a/pcbnew/import_gfx/dxf_import_plugin.cpp +++ b/pcbnew/import_gfx/dxf_import_plugin.cpp @@ -118,7 +118,15 @@ DXF_IMPORT_PLUGIN::~DXF_IMPORT_PLUGIN() bool DXF_IMPORT_PLUGIN::Load( const wxString& aFileName ) { - return ImportDxfFile( aFileName ); + try + { + return ImportDxfFile( aFileName ); + } + catch( const std::bad_alloc& ) + { + reportMsg( _( "Memory was exhausted trying to load the DXF, it may be too large." ) ); + return false; + } }