summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/buffer.c b/buffer.c
index cb44eb4..ca58772 100644
--- a/buffer.c
+++ b/buffer.c
@@ -61,7 +61,10 @@ char const *buffer_get_filename(TextBuffer *buffer) {
}
bool buffer_is_untitled(TextBuffer *buffer) {
- return streq(buffer->filename, TED_UNTITLED);
+ if (buffer->filename)
+ return streq(buffer->filename, TED_UNTITLED);
+ else
+ return false;
}
// add this edit to the undo history