From 369a9fd3cbbc232a8bcd21effd8f886fd104e378 Mon Sep 17 00:00:00 2001 From: Adrian Vollmer Date: Sun, 9 Oct 2022 10:51:32 +0200 Subject: [PATCH] Handle non-existing files gracefully --- zundler/assets/inject.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zundler/assets/inject.js b/zundler/assets/inject.js index 9090756..733595e 100644 --- a/zundler/assets/inject.js +++ b/zundler/assets/inject.js @@ -142,8 +142,13 @@ var is_virtual = function(url) { var retrieve_file = function(path) { // console.log("Retrieving file: " + path); var file_tree = window.global_context.file_tree; - var file = file_tree[path].data; - return file; + var file = file_tree[path]; + if (!file) { + console.log("File not found: " + path); + return ""; + } else { + return file.data; + } }; var normalize_path = function(path) {