Checking for undefined filePath

This fix works for me to avoid the Uncaught TypeError exception (issue #1) when saving new files for the first time