Fix NPE in ScriptService when script file with no extension is deleted

Fixes #7689
This seems dangerous? Shouldn't this be similar to the other try/catches below?