Skip to content

Commit

Permalink
Fix NullPointerException in LogView
Browse files Browse the repository at this point in the history
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)
```
  • Loading branch information
sebthom authored and jukzi committed Dec 4, 2024
1 parent ce9874f commit e8b286e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1250,8 +1250,9 @@ private Throttler createMutualActivate(Display display) {

private void asyncRefreshAndActivate(int severity) {
asyncRefresh();
if ((fActivateViewAction.isChecked()) || (severity >= IStatus.WARNING && fActivateViewWarnAction.isChecked())
|| (severity >= IStatus.ERROR && fActivateViewErrorAction.isChecked())) {
if ((fActivateViewAction != null && fActivateViewAction.isChecked())
|| (severity >= IStatus.WARNING && fActivateViewWarnAction != null && fActivateViewWarnAction.isChecked())
|| (severity >= IStatus.ERROR && fActivateViewErrorAction != null && fActivateViewErrorAction.isChecked())) {
mutualActivate.throttledExec();
}
}
Expand Down

0 comments on commit e8b286e

Please sign in to comment.