guard tonumber from nil by defaulting inside the call
This commit is contained in:
+4
-4
@@ -160,10 +160,10 @@ end
|
|||||||
|
|
||||||
function load_config()
|
function load_config()
|
||||||
sr = fs.open("reactorconfig.txt", "r")
|
sr = fs.open("reactorconfig.txt", "r")
|
||||||
autoInputGate = tonumber(sr.readLine()) or 1
|
autoInputGate = tonumber(sr.readLine() or 1)
|
||||||
curInputGate = tonumber(sr.readLine()) or 222000
|
curInputGate = tonumber(sr.readLine() or 222000)
|
||||||
targetOutput = tonumber(sr.readLine())
|
targetOutput = tonumber(sr.readLine() or 0)
|
||||||
autoOutputGate = tonumber(sr.readLine()) or 0
|
autoOutputGate = tonumber(sr.readLine() or 0)
|
||||||
sr.close()
|
sr.close()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user