From 5999e7856fb43475ff2eb76d79cd341841f3cd3c Mon Sep 17 00:00:00 2001 From: John Colvin Date: Wed, 18 May 2022 12:32:47 -0400 Subject: [PATCH] fix: Add null check for sec metadata in MDDaemon --- src/client/spark/Daemons/MDDaemon.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/spark/Daemons/MDDaemon.cs b/src/client/spark/Daemons/MDDaemon.cs index 7068f2ed1..619a39853 100644 --- a/src/client/spark/Daemons/MDDaemon.cs +++ b/src/client/spark/Daemons/MDDaemon.cs @@ -135,11 +135,13 @@ namespace bts { if (item is null) { throw new InvalidOperationException("Expected non-null SecurityMetadataItem"); } + var price_display = item.Value.PriceDisplay; + var qty_display = item.Value.QuantityDisplay; exch_secs[smd.id] = new( smd.security, smd.md, - new(item.Value.PriceDisplay), - new(item.Value.QuantityDisplay)); + price_display is null ? null : new(price_display), + qty_display is null ? null : new(qty_display)); } } _bus.post(SparkTags.ServerSecuritiesTag, exch_secs);