changeset 73:e972fb08a574 default tip

fix
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 16 Jun 2025 11:29:04 -0600
parents 7db13b68ab1b
children
files src/luan_editor/Window.luan
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/luan_editor/Window.luan	Sun Jun 15 15:31:05 2025 -0600
+++ b/src/luan_editor/Window.luan	Mon Jun 16 11:29:04 2025 -0600
@@ -199,10 +199,12 @@
 			Luan.exit()
 		end
 		remove_list_window_item(list_window_item)
-		local document_info = documents[title] or error(title)
-		document_info.count = document_info.count - 1
-		if document_info.count == 0 then
-			documents[title] = nil
+		local document_info = documents[title]
+		if document_info ~= nil then
+			document_info.count = document_info.count - 1
+			if document_info.count == 0 then
+				documents[title] = nil
+			end
 		end
 	end)
 	frame.add_window_focus_listener(function()