#vulnerable code 
                                @Override
    public void execute (final ButtonEvent event)
    {
        if (event != ButtonEvent.DOWN)
            return;

        final ViewManager viewManager = this.surface.getViewManager ();
        final AbstractTrackBankProxy tb = this.model.getCurrentTrackBank ();
        final TrackData sel = tb.getSelectedTrack ();
        if (sel == null)
        {
            viewManager.setActiveView (Views.VIEW_SESSION);
            return;
        }

        Integer viewID;
        if (Views.isNoteView (viewManager.getActiveViewId ()))
        {
            if (this.surface.isShiftPressed ())
                viewID = viewManager.isActiveView (Views.VIEW_SEQUENCER) ? Views.VIEW_RAINDROPS : Views.VIEW_SEQUENCER;
            else
                viewID = viewManager.isActiveView (Views.VIEW_PLAY) ? Views.VIEW_DRUM : Views.VIEW_PLAY;
        }
        else
        {
            viewID = viewManager.getPreferredView (sel.getPosition ());
            if (viewID == null)
                viewID = this.surface.isShiftPressed () ? Views.VIEW_SEQUENCER : Views.VIEW_PLAY;
        }
        viewManager.setActiveView (viewID);
        viewManager.setPreferredView (sel.getPosition (), viewID);
    } 
                            #location 30 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Override
    public void execute (final ButtonEvent event)
    {
        if (event != ButtonEvent.DOWN)
            return;

        final ViewManager viewManager = this.surface.getViewManager ();
        final AbstractTrackBankProxy tb = this.model.getCurrentTrackBank ();
        final TrackData sel = tb.getSelectedTrack ();
        if (sel == null)
        {
            viewManager.setActiveView (Views.VIEW_SESSION);
            return;
        }

        if (Views.isNoteView (viewManager.getActiveViewId ()))
        {
            if (this.surface.isShiftPressed ())
                this.seqSelect.executeNormal (event);
            else
                this.playSelect.executeNormal (event);
        }
        else
        {
            final Integer viewID = viewManager.getPreferredView (sel.getPosition ());
            if (viewID == null)
                this.seqSelect.executeNormal (event);
            else
                viewManager.setActiveView (viewID);
        }

        viewManager.setPreferredView (sel.getPosition (), viewManager.getActiveViewId ());
        this.surface.getDisplay ().notify (viewManager.getActiveView ().getName ());
    }