 
         create_file = (ext) =>
             p = path(ext)
+
+            if not p
+                return false
+
             ext = misc.filename_extension(p)
 
             if ext == 'term'

# timeout in seconds when downloading files etc., from web in +New dialog.
FROM_WEB_TIMEOUT_S = 45


# How long to cache public paths in this project
PUBLIC_PATHS_CACHE_TIMEOUT_MS = 1000*60

            if ext in BANNED_FILE_TYPES
                alert_message(type:"error", message:"Creation of #{ext} files not supported.", timeout:3)
                return false

            if ext == 'tex'
                for bad_char in BAD_LATEX_FILENAME_CHARACTERS
                    if p.indexOf(bad_char) != -1
                        bootbox.alert("Filenames must not contain the character '#{bad_char}'.")
                        return false

            if p.length == 0
                @new_file_tab_input.focus()
