Skip to content

Commit 65a53d4

Browse files
sebthommickaelistria
authored andcommitted
Fix NullPointerException in LogView
This commit addresses an occasionally occurring NullPointerException in the LogView class: ``` LogListener.logged threw a non-fatal unchecked exception as follows: java.lang.NullPointerException: Cannot invoke "org.eclipse.jface.action.Action.isChecked()" because "this.fActivateViewAction" is null at org.eclipse.ui.internal.views.log.LogView.asyncRefreshAndActivate(LogView.java:1253) at org.eclipse.ui.internal.views.log.LogView.pushEntry(LogView.java:1212) at org.eclipse.ui.internal.views.log.LogView.logged(LogView.java:1143) at org.eclipse.osgi.internal.log.ExtendedLogReaderServiceFactory.safeLogged(ExtendedLogReaderServiceFactory.java:108) at org.eclipse.osgi.internal.log.ExtendedLogReaderServiceFactory$LogTask.run(ExtendedLogReaderServiceFactory.java:56) at org.eclipse.osgi.internal.log.OrderedExecutor$OrderedTaskQueue$OrderedTask.run(ExtendedLogReaderServiceFactory.java:458) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583) ```
1 parent 56df767 commit 65a53d4

File tree

1 file changed

+3
-2
lines changed
  • bundles/org.eclipse.ui.views.log/src/org/eclipse/ui/internal/views/log

1 file changed

+3
-2
lines changed

bundles/org.eclipse.ui.views.log/src/org/eclipse/ui/internal/views/log/LogView.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,8 +1250,9 @@ private Throttler createMutualActivate(Display display) {
12501250

12511251
private void asyncRefreshAndActivate(int severity) {
12521252
asyncRefresh();
1253-
if ((fActivateViewAction.isChecked()) || (severity >= IStatus.WARNING && fActivateViewWarnAction.isChecked())
1254-
|| (severity >= IStatus.ERROR && fActivateViewErrorAction.isChecked())) {
1253+
if ((fActivateViewAction != null && fActivateViewAction.isChecked())
1254+
|| (severity >= IStatus.WARNING && fActivateViewWarnAction != null && fActivateViewWarnAction.isChecked())
1255+
|| (severity >= IStatus.ERROR && fActivateViewErrorAction != null && fActivateViewErrorAction.isChecked())) {
12551256
mutualActivate.throttledExec();
12561257
}
12571258
}

0 commit comments

Comments
 (0)