From ccd9c9c8c175e7ca2a98435fd460576d9e42f8c5 Mon Sep 17 00:00:00 2001 From: cheapie Date: Thu, 5 Dec 2024 20:56:24 -0600 Subject: Fix crash when launching mView on a computer with no hard drive --- laptop.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/laptop.lua b/laptop.lua index 7e3d16c..a65739c 100644 --- a/laptop.lua +++ b/laptop.lua @@ -5,6 +5,7 @@ laptop.register_app("celevator",{ formspec_func = function(_,mtos) local ram = mtos.bdev:get_app_storage("ram","celevator") local mem = mtos.bdev:get_app_storage("hdd","celevator") + if not mem then return mtos.theme:get_label("0.5,0.5","This application requires a hard disk drive.") end if not mem.connections then mem.connections = {} end if not ram.screenstate then ram.screenstate = (#mem.connections > 0 and "connections" or "welcome") end if not mem.selectedconnection then mem.selectedconnection = 1 end @@ -298,6 +299,7 @@ laptop.register_app("celevator",{ receive_fields_func = function(app,mtos,_,fields) local ram = mtos.bdev:get_app_storage("ram","celevator") local mem = mtos.bdev:get_app_storage("hdd","celevator") + if not mem then return end if ram.screenstate == "welcome" then if fields.connections then ram.screenstate = "connections" -- cgit v1.2.3