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

Fixes #7689
Yeah, I missed it somehow. Fixed.