summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"