From e13f35467243b5b14982623e16d16e13e6f975ec Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 1 May 2002 02:47:18 +0000 Subject: [PATCH] Oops, forgot that ResourceBundle throws a MissingResourceException rather than returning null. Whee! git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1322 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/util/MessageManager.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/java/com/threerings/util/MessageManager.java b/src/java/com/threerings/util/MessageManager.java index 12405d4f4..0e87cff0f 100644 --- a/src/java/com/threerings/util/MessageManager.java +++ b/src/java/com/threerings/util/MessageManager.java @@ -1,5 +1,5 @@ // -// $Id: MessageManager.java,v 1.3 2002/05/01 02:45:00 mdb Exp $ +// $Id: MessageManager.java,v 1.4 2002/05/01 02:47:18 mdb Exp $ package com.threerings.util; @@ -94,13 +94,18 @@ public class MessageManager // if the resource bundle contains a special resource, we'll // interpret that as a derivation of MessageBundle to instantiate // for handling that class - String mbclass = null; if (rbundle != null) { - mbclass = rbundle.getString(MBUNDLE_CLASS_KEY); - } - if (!StringUtil.blank(mbclass)) { + String mbclass = null; try { - bundle = (MessageBundle)Class.forName(mbclass).newInstance(); + mbclass = rbundle.getString(MBUNDLE_CLASS_KEY); + if (!StringUtil.blank(mbclass)) { + bundle = (MessageBundle) + Class.forName(mbclass).newInstance(); + } + + } catch (MissingResourceException mre) { + // nothing to worry about + } catch (Throwable t) { Log.warning("Failure instantiating custom message bundle " + "[mbclass=" + mbclass + ", error=" + t + "].");