From 6b13f04da94f2f604241c8382e13b6f483a69da4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Laurent?= <francois.laurent@posteo.net>
Date: Fri, 21 Feb 2025 17:51:32 +0100
Subject: [PATCH] fix: tryopenfile updates :input on missing or failing input
 file

---
 src/files.jl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/files.jl b/src/files.jl
index 100d81d..a9f9a12 100644
--- a/src/files.jl
+++ b/src/files.jl
@@ -104,9 +104,15 @@ function tryopenfile(controller, path; reload::Bool=false)
         turn_load_animation_on(controller)
     end
     #
+    if !isfile(path)
+        @error "Cannot find file" file=path
+        hub[:input][] = nothing
+        return
+    end
     records = loadfile(path)
     if isempty(records)
         @info "Cannot load file" file=path
+        hub[:input][] = nothing
         return
     elseif haskey(hub, :input)
         hub[:input][] = path
-- 
GitLab