Fix for lua runtime error on startup.
authorCameron Ball <c.ball1729@gmail.com>
Wed, 4 Dec 2013 03:29:02 +0000 (11:29 +0800)
committerCameron Ball <c.ball1729@gmail.com>
Wed, 4 Dec 2013 03:29:02 +0000 (11:29 +0800)
Themes/GrooveNights/Scripts/gnCustomOptions.lua

index d7f1528..99ad754 100644 (file)
@@ -1,5 +1,10 @@
 -- This is purely for convenience
-local ProfileTable = PROFILEMAN:GetMachineProfile():GetSaved()
+local ProfileTable
+
+-- Without this check, when StepMania starts it will report a lua runtime error as PROFILEMAN apparently doesn't exist yet.
+if PROFILEMAN ~= nil then
+    ProfileTable = PROFILEMAN:GetMachineProfile():GetSaved()
+end
 
 -- Valid speed mod row type names.
 local Names = { "Basic", "Advanced", "Pro" }