From 1731756712b188adc398ccd63c5d74ff53923c18 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 13 Dec 2001 06:34:40 +0000 Subject: [PATCH] Improved error checking and reporting. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@769 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../crowd/client/LocationDirector.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/java/com/threerings/crowd/client/LocationDirector.java b/src/java/com/threerings/crowd/client/LocationDirector.java index 30e73f405..ad5c6a823 100644 --- a/src/java/com/threerings/crowd/client/LocationDirector.java +++ b/src/java/com/threerings/crowd/client/LocationDirector.java @@ -1,5 +1,5 @@ // -// $Id: LocationDirector.java,v 1.14 2001/10/24 03:10:30 mdb Exp $ +// $Id: LocationDirector.java,v 1.15 2001/12/13 06:34:40 mdb Exp $ package com.threerings.crowd.client; @@ -173,15 +173,16 @@ public class LocationDirector _previousPlaceId = _placeId; _placeId = placeId; + Class cclass = config.getControllerClass(); try { // start up a new place controller to manage the new place - Class cclass = config.getControllerClass(); _controller = (PlaceController)cclass.newInstance(); _controller.init(_ctx, config); } catch (Exception e) { Log.warning("Error creating or initializing place controller " + - "[config=" + config + "]."); + "[cclass=" + cclass.getName() + + ", config=" + config + "]."); Log.logStackTrace(e); } @@ -286,12 +287,14 @@ public class LocationDirector _plobj = (PlaceObject)object; // let the place controller know that we're ready to roll - try { - _controller.willEnterPlace(_plobj); - } catch (Exception e) { - Log.warning("Controller choked in willEnterPlace " + - "[place=" + _plobj + "]."); - Log.logStackTrace(e); + if (_controller != null) { + try { + _controller.willEnterPlace(_plobj); + } catch (Exception e) { + Log.warning("Controller choked in willEnterPlace " + + "[place=" + _plobj + "]."); + Log.logStackTrace(e); + } } // let our observers know that all is well on the western front