Malformed aspect crashes application when going into split view

Issue #204 resolved
Calem Bendell created an issue

Image of the frozen GUI at the bottom. Files attached.

Was attempting to switch into the multiple aspect display mode.

Error message:

Exception in thread "Animation Thread" java.lang.NullPointerException
    at org.mt4j.components.MTComponent.addChild(MTComponent.java:1890)
    at org.mt4j.components.MTComponent.addChild(MTComponent.java:1878)
    at ca.mcgill.ram.ui.scenes.DisplayAspectScene.switchToView(DisplayAspectScene.java:517)
    at ca.mcgill.ram.ui.views.InstantiationSplitEditingView.<init>(InstantiationSplitEditingView.java:72)
    at ca.mcgill.ram.ui.handler.impl.DisplaySceneHandler.switchToInstantiationEditMode(DisplaySceneHandler.java:200)
    at ca.mcgill.ram.ui.handler.impl.InstantiationViewHandler.switchToSplitView(InstantiationViewHandler.java:80)
    at ca.mcgill.ram.ui.views.InstantiationTitleView.actionPerformed(InstantiationTitleView.java:165)
    at ca.mcgill.ram.ui.components.RamButton$ButtonHandler.processTapEvent(RamButton.java:50)
    at ca.mcgill.ram.ui.handler.BaseHandler.processGestureEvent(BaseHandler.java:78)
    at ca.mcgill.ram.ui.components.RamButton.processGestureEvent(RamButton.java:193)
    at ca.mcgill.ram.ui.components.ContainerComponent.processGestureEvent(ContainerComponent.java:177)
    at org.mt4j.input.GestureEventSupport.fire(GestureEventSupport.java:184)
    at org.mt4j.input.GestureEventSupport.fireGestureEvt(GestureEventSupport.java:169)
    at org.mt4j.components.MTComponent.processGestureEvent(MTComponent.java:3033)
    at org.mt4j.input.inputProcessors.componentProcessors.AbstractComponentProcessor.fireGestureEvent(AbstractComponentProcessor.java:236)
    at org.mt4j.input.inputProcessors.componentProcessors.AbstractCursorProcessor.fireGestureEvent(AbstractCursorProcessor.java:169)
    at org.mt4j.input.inputProcessors.componentProcessors.tapProcessor.TapProcessor.endGesture(TapProcessor.java:211)
    at org.mt4j.input.inputProcessors.componentProcessors.tapProcessor.TapProcessor.cursorEnded(TapProcessor.java:172)
    at org.mt4j.input.inputProcessors.componentProcessors.AbstractCursorProcessor.processInputEvtImpl(AbstractCursorProcessor.java:143)
    at org.mt4j.input.inputProcessors.componentProcessors.AbstractComponentProcessor.processInputEvent(AbstractComponentProcessor.java:87)
    at org.mt4j.input.ComponentInputProcessorSupport.processInputEvent(ComponentInputProcessorSupport.java:76)
    at org.mt4j.components.MTComponent.dispatchInputEvent(MTComponent.java:2853)
    at org.mt4j.components.MTComponent.processInputEvent(MTComponent.java:2983)
    at org.mt4j.components.MTCanvas.processInputEvent(MTCanvas.java:449)
    at org.mt4j.input.inputProcessors.globalProcessors.AbstractGlobalInputProcessor.fireInputEvent(AbstractGlobalInputProcessor.java:138)
    at org.mt4j.input.inputProcessors.globalProcessors.InputRetargeter.processInputEvtImpl(InputRetargeter.java:91)
    at org.mt4j.input.inputProcessors.globalProcessors.AbstractGlobalInputProcessor.processInputEvent(AbstractGlobalInputProcessor.java:67)
    at org.mt4j.input.inputSources.AbstractInputSource.fireInputEvent(AbstractInputSource.java:208)
    at org.mt4j.input.inputSources.AbstractInputSource.flushEvents(AbstractInputSource.java:183)
    at org.mt4j.input.inputSources.AbstractInputSource.pre(AbstractInputSource.java:126)
    at org.mt4j.input.inputSources.AbstractInputSource.processAction(AbstractInputSource.java:86)
    at org.mt4j.AbstractMTApplication.runApplication(AbstractMTApplication.java:327)
    at org.mt4j.AbstractMTApplication.draw(AbstractMTApplication.java:272)
    at processing.core.PApplet.handleDraw(PApplet.java:1603)
    at processing.core.PApplet.run(PApplet.java:1502)
    at java.lang.Thread.run(Unknown Source)

aspectviewswitchbug.png

Comments (7)

  1. Matthias Schoettle

    It's because WindowInitialiser is malformed. There is no structural view, for example. How did you create that model?

  2. Matthias Schoettle
    • changed status to open

    The place where the occurring exception is caught is in the DisplayAspectScene itself. This is bad, because the caller will have no idea that an exception occurred. Instead, the caller should catch the exception and take appropriate measures.

  3. Matthias Schoettle

    Resolved issue #204: Moved catching the exception to where the scene gets created. If an exception occurs, null is returned (instead of an incomplete scene). The caller has to ensure that the return is not null and if it is a popup will be displayed to the user.

    → <<cset 471c05325b2e>>

  4. Log in to comment