From 031772bfccaed42cc23bd8b0378f2176b3030b8e Mon Sep 17 00:00:00 2001 From: kevans Date: Mon, 1 Jun 2020 23:26:37 +0000 Subject: [PATCH] lualoader: improve drawer error handling At least one user has landed in a scenario where logo files appear to be misnamed, and we failed to find them. Our fallback for missing logodefs is orb/orbbw, based on the color status. In a scenario where we can't locate the logos, though, this is not ideal. Add in one more layer of fallback to properly just don't draw any logo if the fan has been jam packed with foreign material. PR: 246046 MFC after: 3 days --- stand/lua/drawer.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index 6a5b62b79817..12a27bfda233 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -258,6 +258,11 @@ local function drawlogo() else logodef = getLogodef(drawer.default_bw_logodef) end + + -- Something has gone terribly wrong. + if logodef == nil then + logodef = getLogodef(drawer.default_fallback_logodef) + end end if logodef ~= nil and logodef.graphic == none then @@ -355,6 +360,9 @@ shift = default_shift drawer.default_brand = 'fbsd' drawer.default_color_logodef = 'orb' drawer.default_bw_logodef = 'orbbw' +-- For when things go terribly wrong; this def should be present here in the +-- drawer module in case it's a filesystem issue. +drawer.default_fallback_logodef = 'none' function drawer.addBrand(name, def) branddefs[name] = def