Don't try to compare if decimal value is nil.#24
Don't try to compare if decimal value is nil.#24metrix78 wants to merge 1 commit intoib-ruby:masterfrom
Conversation
|
Hi, Question? Why returned read_float nil? |
These are valid option contracts from TWS that are causing the library to crash.
I can do that, but it looks like empty values are returned for every location that uses decimal_limit. See below: Uses of decimal_limit_1:
Uses of decimal_limit_2:
Example message parsed into a hash: Every call to |
|
After re-reading your comment, I think I see what you're saying. You would like read_float to return a valid integer other than blank if the data is valid? In this case I would l think an empty string, or nil would be the best option. It wouldn't make sense to return a 0 for a greek. |
|
if nil (or blank) is a valid data received from the tws, read_float is the wrong method to capture the input. Can you write a small test to work on this feature? (or explain the error on detail, then I write it ) |
|
What interface do you need data for a test? Directly from the TCPSocket? or data formatted between a specific method call. I was fixing this bug for a bit of understanding on how the development process works on this project. I've found a bigger issue that will cause the application to crash when two messages are ready to read from the |
|
If you want, lets focus on the issues together. |
|
There are a few in-situ message tests in spec/ib/messages. They may act as prototype. |
Gem fails reading opton greeks if a decimal value is empty. Modified code to check for nils before running a comparison.
Error: