It seems like this check should be wrapping the whole method -- if some unrelated file got deleted, we want to just totally no-op.

Also, this looks a bit similar to the handleFileClose() patch in your other PR.  I wonder if there's any way to leverage that logic to fix this bug, instead of rewriting something similar here?