From 8e8cd49001dd9ff07487324967200bf9355bc34b Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sun, 15 Oct 2023 09:50:58 +0200 Subject: [PATCH] edited error handling --- src/core/Global.ttslua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 43cffd2a..39340a30 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -716,19 +716,17 @@ function onMouseEnter_item(player, param) -- get metadata from library local item = library[contentToShow][index] - -- error handling + -- error handling (only author + description can by empty) if not item or not item.name or item.name == "" - or not item.author or item.author == "" - or not item.description or item.description == "" or not item.boxsize or item.boxsize == "" or not item.boxart or item.boxart == "" then return end UI.setValue("previewTitle", item.name) - UI.setValue("previewAuthor", "by " .. item.author) - UI.setValue("previewDescription", item.description) + UI.setValue("previewAuthor", "by " .. (item.author) or "Unknown") + UI.setValue("previewDescription", item.description or "") -- update mask according to size local maskData = {}