From bb1f34149aae679b720aae259a132a3d7f52a853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Ritzl?= Date: Tue, 10 Dec 2019 07:11:30 +0100 Subject: [PATCH] Check if proxy is missing resources when loading/showing it Fixes #56 --- monarch/monarch.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/monarch/monarch.lua b/monarch/monarch.lua index bc10447..d04c2ef 100644 --- a/monarch/monarch.lua +++ b/monarch/monarch.lua @@ -371,6 +371,13 @@ local function preload(screen) screen.preloading = true if screen.proxy then log("preload() proxy") + local missing_resources = collectionproxy.missing_resources(screen.proxy) + if #missing_resources > 0 then + local error_message = ("preload() collection proxy %s is missing resources"):format(tostring(screen.id)) + log(error_message) + screen.preloading = false + return false, error_message + end screen.wait_for = PROXY_LOADED msg.post(screen.proxy, ASYNC_LOAD) coroutine.yield()