summaryrefslogtreecommitdiff
path: root/node.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-03-01 15:02:40 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-03-01 15:02:40 -0500
commit12bb6e2cd377d3dfa2f7ec037c31463c3f9070d1 (patch)
treee3311ad77bd0fb768adcdce7582397cf97f40183 /node.c
parent2d327302b30bf67a87538dc5e005c0399c0b8f1a (diff)
restore session
Diffstat (limited to 'node.c')
-rw-r--r--node.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/node.c b/node.c
index e6a2f97..7facab2 100644
--- a/node.c
+++ b/node.c
@@ -271,7 +271,7 @@ static void node_frame(Ted *ted, Node *node, Rect r) {
TextBuffer *buffer = &ted->buffers[node->tabs[i]];
char tab_title[256];
char const *path = buffer_get_filename(buffer);
- char const *filename = path_filename(path);
+ char const *filename = path ? path_filename(path) : TED_UNTITLED;
Rect tab_rect = rect(V2(r.pos.x + tab_width * i, r.pos.y), V2(tab_width, tab_bar_height));
if (node == ted->dragging_tab_node && i == ted->dragging_tab_idx) {