Fix NPE exception in occurrence updater

I'm not sure why this exception occurs but I guess that whenever an
editor is closed, its compilation unit is removed but the job for the update occurrences feature may still be running. We just need to check if null is returned and do nothing in this case.