Skip to content

NullPointerException on initialisation on Eclipse Neon 4.6 #1

Description

@King07

screen shot 2017-06-13 at 09 10 35

The problem occurs on line 418 in the fluorite.model.EventRecorder.java where "Shell shell = Display.getDefault().getActiveShell();" produce a NULL pointer.

Solution: Add the below function to the fluorite.model.EventRecorder.java file and call that function to get the Shell on line 418.

protected Shell getShell() {
    Shell shell = null;

    IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (activeWorkbenchWindow != null) {
        shell = activeWorkbenchWindow.getShell();
    }
    if (shell == null) {
        Display dis = Display.getCurrent();
        if (dis == null) {
            dis = Display.getDefault();
        }
        if (dis != null) {
            shell = dis.getActiveShell();
        }
    }
    if (shell == null) {
        shell = new Shell();
    }
    return shell;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions