From 01a38ee6fc8d14b025236cc9ae078cd5229589be Mon Sep 17 00:00:00 2001 From: Navid Sassan Date: Tue, 9 Dec 2025 22:31:57 +0100 Subject: [PATCH] fix input validation --- de_react_auto | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/de_react_auto b/de_react_auto index fc1cfed..8cf8e0e 100644 --- a/de_react_auto +++ b/de_react_auto @@ -265,17 +265,17 @@ local function updateReactorInfo() end end - -- Check for zero max values (would cause division by zero) - -- Only flag as error if reactor is not offline (these are expected to be 0 when cold) - local isOffline = reactorInfo.status == "cold" or reactorInfo.status == "invalid" - if not isOffline then - if reactorInfo.maxFieldStrength ~= nil and reactorInfo.maxFieldStrength <= 0 then - table.insert(fieldErrors, "maxFieldStrength <= 0") - end - if reactorInfo.maxEnergySaturation ~= nil and reactorInfo.maxEnergySaturation <= 0 then - table.insert(fieldErrors, "maxEnergySaturation <= 0") - end - end + -- -- Check for zero max values (would cause division by zero) + -- -- Only flag as error if reactor is not offline (these are expected to be 0 when cold) + -- local isOffline = reactorInfo.status == "cold" or reactorInfo.status == "invalid" + -- if not isOffline then + -- if reactorInfo.maxFieldStrength ~= nil and reactorInfo.maxFieldStrength <= 0 then + -- table.insert(fieldErrors, "maxFieldStrength <= 0") + -- end + -- if reactorInfo.maxEnergySaturation ~= nil and reactorInfo.maxEnergySaturation <= 0 then + -- table.insert(fieldErrors, "maxEnergySaturation <= 0") + -- end + -- end -- Set error message if we have field errors if #fieldErrors > 0 then