From: kruland2607 Date: Wed, 18 Apr 2012 19:48:56 +0000 (+0000) Subject: Hack for working around unknown materials. Need to address the FIXME X-Git-Tag: upstream/12.09^2~351 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=bf61c548647357f96446d116416a2e636185a02a;p=debian%2Fopenrocket Hack for working around unknown materials. Need to address the FIXME git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@569 180e2498-e6e9-4542-8430-84ac67f01cd8 --- diff --git a/core/src/net/sf/openrocket/file/preset/ColumnDefinition.java b/core/src/net/sf/openrocket/file/preset/ColumnDefinition.java index e58a042b..69286427 100644 --- a/core/src/net/sf/openrocket/file/preset/ColumnDefinition.java +++ b/core/src/net/sf/openrocket/file/preset/ColumnDefinition.java @@ -52,7 +52,14 @@ public class ColumnDefinition { String translated_value = Application.getTranslator().get("Databases.materials.Paperoffice"); return getMaterialFor(translated_value); } - throw new IllegalArgumentException("Invalid material " + value + " in component preset."); + try { + return getMaterialFor(value); + } + catch (IllegalArgumentException ex ) { + // FIXME - what can we do if the material in the file is not defined? + Material m = new Material.Bulk(value, 0, true); + return m; + } } if ( type.equals(Shape.class) ) { //FIXME - ignore case!