From 08ea79f2de94045dc33e3d252690ede0725c2875 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Sun, 13 Jul 2025 20:52:10 +0200 Subject: [PATCH] Make sure error printing don't get non-existent line --- wip-duuqnd/user-side-compiler/error-handling.lisp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wip-duuqnd/user-side-compiler/error-handling.lisp b/wip-duuqnd/user-side-compiler/error-handling.lisp index ed4e95c..9e7a36e 100644 --- a/wip-duuqnd/user-side-compiler/error-handling.lisp +++ b/wip-duuqnd/user-side-compiler/error-handling.lisp @@ -8,7 +8,9 @@ :finally (return start)))) (subseq string start - (position #\Newline string :start (1+ start))))) + (if (< start (length string)) + (position #\Newline string :start (1+ start)) + nil)))) (defun point-out-source (source) (if (null source)