aboutsummaryrefslogtreecommitdiff
path: root/core/file_io.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/file_io.lua')
-rw-r--r--core/file_io.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/file_io.lua b/core/file_io.lua
index ed2b8c55..25fe2c0e 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -102,8 +102,8 @@ function save_as(buffer, filename)
if not filename then
filename = cocoa_dialog( 'filesave', {
title = 'Save',
- ['with-directory'] = buffer.filename:match('.+/'),
- ['with-file'] = buffer.filename:match('[^/]+$'),
+ ['with-directory'] = (buffer.filename or ''):match('.+/'),
+ ['with-file'] = (buffer.filename or ''):match('[^/]+$'),
['no-newline'] = true
} )
end