summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-12-05 20:56:24 -0600
committercheapie <no-email-for-you@example.com>2024-12-05 20:56:24 -0600
commitccd9c9c8c175e7ca2a98435fd460576d9e42f8c5 (patch)
treeaaebbc9799ece2978ffb23e38ce6536e744a2d78
parent0be10ecc617cb8593cef8012658f3dd2be069528 (diff)
downloadcelevator-ccd9c9c8c175e7ca2a98435fd460576d9e42f8c5.tar
celevator-ccd9c9c8c175e7ca2a98435fd460576d9e42f8c5.tar.gz
celevator-ccd9c9c8c175e7ca2a98435fd460576d9e42f8c5.tar.bz2
celevator-ccd9c9c8c175e7ca2a98435fd460576d9e42f8c5.tar.xz
celevator-ccd9c9c8c175e7ca2a98435fd460576d9e42f8c5.zip
Fix crash when launching mView on a computer with no hard drive
-rw-r--r--laptop.lua2
1 files changed, 2 insertions, 0 deletions
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"