iTrace-Dev / iTrace

Infrastructure supporting implicit eye tracking on software artifacts within the IDE and browser.
http://www.i-trace.org
2 stars 0 forks source link

NullPointerException when start tracking with no editor open #64

Closed jennalwise closed 7 years ago

jennalwise commented 7 years ago

When an editor window isn't open and you start tracking iTrace will throw a NullPointerException: java.lang.NullPointerException at edu.ysu.itrace.ControlView$1.runInUIThread(ControlView.java:157)

This is the problem line in ControlView: PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage() .getActiveEditor().getEditorSite().getActionBars() .getStatusLineManager() .setMessage(String.valueOf(""));

.getActiveEditor() will return null since there are not any open EditorParts This only happens if a gaze in the queue is considered null. This happens in branch master and in branch issue2, however it did not happen in branch issue2 before I merged master into it. issue2 was very outdated, but it is worth noting that a commit after the issue2 branch was created introduced this error.

onebenclark commented 7 years ago

This was my mistake. This was introduced when I added the ability to print the session time to the status bar. I didn't think to test this without an editor open. I'll figure what to do about it.

onebenclark commented 7 years ago

Okay I fixed it. I changed so that the statusLineManager in control view is set to the active editor's whenever it is activated or brought to the top. This is done through the control view's IPartListener2 methods.