Updating copy to file path function to fail gracefully when the buffer does not contain a filename.