#vulnerable code 
                                protected void moveUp ()
    {
        // There is no device on the track move upwards to the track view
        final CursorDeviceProxy cd = this.model.getCursorDevice ();
        if (!cd.hasSelectedDevice ())
        {
            this.surface.getViewManager ().getActiveView ().executeTriggerCommand (Commands.COMMAND_TRACK, ButtonEvent.DOWN);
            return;
        }

        // Parameter banks are shown -> show devices
        final ModeManager modeManager = this.surface.getModeManager ();
        final DeviceParamsMode deviceParamsMode = (DeviceParamsMode) modeManager.getMode (Modes.MODE_DEVICE_PARAMS);
        if (!deviceParamsMode.isShowDevices ())
        {
            deviceParamsMode.setShowDevices (true);
            return;
        }

        // Devices are shown, if nested show the layers otherwise move up to the tracks
        if (cd.isNested ())
        {
            cd.selectParent ();
            modeManager.setActiveMode (Modes.MODE_DEVICE_LAYER);
            deviceParamsMode.setShowDevices (false);
            cd.selectChannel ();
            return;
        }

        // Move up to the track
        this.surface.getViewManager ().getActiveView ().executeTriggerCommand (Commands.COMMAND_TRACK, ButtonEvent.DOWN);
    } 
                            #location 7 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                protected void moveUp ()
    {
        // There is no device on the track move upwards to the track view
        final CursorDeviceProxy cd = this.model.getCursorDevice ();
        final View activeView = this.surface.getViewManager ().getActiveView ();
        if (!cd.hasSelectedDevice ())
        {
            activeView.executeTriggerCommand (Commands.COMMAND_TRACK, ButtonEvent.DOWN);
            return;
        }

        // Parameter banks are shown -> show devices
        final ModeManager modeManager = this.surface.getModeManager ();
        final DeviceParamsMode deviceParamsMode = (DeviceParamsMode) modeManager.getMode (Modes.MODE_DEVICE_PARAMS);
        if (!deviceParamsMode.isShowDevices ())
        {
            deviceParamsMode.setShowDevices (true);
            return;
        }

        // Devices are shown, if nested show the layers otherwise move up to the tracks
        if (cd.isNested ())
        {
            cd.selectParent ();
            modeManager.setActiveMode (Modes.MODE_DEVICE_LAYER);
            deviceParamsMode.setShowDevices (false);
            cd.selectChannel ();
            return;
        }

        // Move up to the track
        if (this.model.isCursorDeviceOnMasterTrack ())
        {
            activeView.executeTriggerCommand (Commands.COMMAND_MASTERTRACK, ButtonEvent.DOWN);
            activeView.executeTriggerCommand (Commands.COMMAND_MASTERTRACK, ButtonEvent.UP);
        }
        else
            activeView.executeTriggerCommand (Commands.COMMAND_TRACK, ButtonEvent.DOWN);
    }