guard tonumber from nil by defaulting inside the call

This commit is contained in:
2026-07-18 21:57:19 +02:00
parent ca48907ae9
commit e0f88e5f2e
+4 -4
View File
@@ -160,10 +160,10 @@ end
function load_config()
sr = fs.open("reactorconfig.txt", "r")
autoInputGate = tonumber(sr.readLine()) or 1
curInputGate = tonumber(sr.readLine()) or 222000
targetOutput = tonumber(sr.readLine())
autoOutputGate = tonumber(sr.readLine()) or 0
autoInputGate = tonumber(sr.readLine() or 1)
curInputGate = tonumber(sr.readLine() or 222000)
targetOutput = tonumber(sr.readLine() or 0)
autoOutputGate = tonumber(sr.readLine() or 0)
sr.close()
end