Skip to content

Commit 58c07ef

Browse files
committed
don't assume the autosave toc file exists
1 parent f140b2d commit 58c07ef

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

gui-lib/framework/private/autosave.rkt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@
6262
;; -> autosave-toc
6363
;; assumes in the dynamic-extent of the thunk passed to with-autosave-filesystem-lock
6464
(define (get-autosave-toc-content)
65-
(call-with-input-file (current-toc-path)
66-
(λ (port)
67-
(read port))))
65+
(define path (current-toc-path))
66+
(cond
67+
[(file-exists? path)
68+
(call-with-input-file path read)]
69+
[else '()]))
6870

6971
;; autosave-toc -> void
7072
;; assumes in the dynamic-extent of the thunk passed to with-autosave-filesystem-lock

0 commit comments

Comments
 (0)