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

Fixes #7689