MirConfig.getProp throws an exception if the config value is not present which kind...
authormh <mh>
Mon, 23 Dec 2002 03:36:47 +0000 (03:36 +0000)
committermh <mh>
Mon, 23 Dec 2002 03:36:47 +0000 (03:36 +0000)
source/mircoders/global/MirGlobal.java

index f56b47d..578c94d 100755 (executable)
@@ -90,7 +90,15 @@ public class MirGlobal {
   public static String getConfigPropertyWithDefault(String aPropertyName, String aDefault) {
     String result;
 
-    result = config().getProp(aPropertyName);
+    //this try-catch is sort of a hack, if we make everything use MirGlobal
+    //instead of MirConfig, we can get rid of the Runtime exception we through
+    //in getProp, and deal with it here.. needs more thinking.. -mh
+    try {
+      result = config().getProp(aPropertyName);
+    } catch (Throwable t) {
+      result = aDefault;
+    }
+       
 
     if (result==null)
       result = aDefault;