jrhurley2 / TDInterface-Public

Windows Form application that uses TD Ameritrade Apis
3 stars 1 forks source link

Added new methods to check orderlegcollection for null before accessing #147

Closed jrhurley2 closed 1 year ago

jrhurley2 commented 1 year ago

Take Profit and Cancel all buttons were causing a null reference exception intermittently. What was happening, is there was still an active OCO order. OCO orders do not have an OrderCollection, so the linq statement that was getting the stop orders or all active orders for a symbol, didn't filter out where the OrderCollection was null.