From 4c0c46cfbbd9d59f73fb6f50e2e5b60f53c19b10 Mon Sep 17 00:00:00 2001 From: Brandon Coleman Date: Mon, 18 Jul 2022 22:41:38 -0500 Subject: [PATCH] Don't try to compare if data passed in is nil. --- lib/ib/support.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ib/support.rb b/lib/ib/support.rb index 173e417..14e61ee 100644 --- a/lib/ib/support.rb +++ b/lib/ib/support.rb @@ -29,13 +29,17 @@ def read_decimal ## Values -1 and below indicate: Not computed (TickOptionComputation) def read_decimal_limit_1 i= read_float - i <= -1 ? nil : i + return nil if i.nil? + return nil if i <= -1 + i end ## Values -2 and below indicate: Not computed (TickOptionComputation) def read_decimal_limit_2 i= read_float - i <= -2 ? nil : i + return nil if i.nil? + return nil if i <= -2 + i end