guard tonumber from nil by defaulting inside the call
This commit is contained in:
+4
-4
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user