Don't call methods on an undefined string.
Merge pull request #94 from Bluerise/fileextension

Don't call methods on an undefined string.