I am trying to run the Lean Report generator locally from a json report downloaded from a run done on QuantConnect and it fails because a loaded option symbol has a null underlying reference and fails at SecurityService.cs line 131

If I look at the json, the option symbols do have the underlying:     

"Symbol": { "Value": "WAG 101016P00025000", "ID": "WAG 2YPXFKVWULF1I|WAG R735QTJ8XC9X", "Permtick": "WAG 101016P00025000", "Underlying": { "Value": "WAG", "ID": "WAG R735QTJ8XC9X", "Permtick": "WAG" } }

Here is the stack:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at QuantConnect.Securities.SecurityService.CreateSecurity (QuantConnect.Symbol symbol, System.Collections.Generic.List`1[T] subscriptionDataConfigList, System.Decimal leverage, System.Boolean addToSymbolCache) [0x00272] in /home/ari/Development/projects/Lean/Common/Securities/SecurityService.cs:131 at QuantConnect.Securities.SecurityManager.CreateSecurity (QuantConnect.Symbol symbol, System.Collections.Generic.List`1[T] subscriptionDataConfigList, System.Decimal leverage, System.Boolean addToSymbolCache) [0x00001] in /home/ari/Development/projects/Lean/Common/Securities/SecurityManager.cs:302 at QuantConnect.Report.PortfolioLooperAlgorithm.FromOrders (System.Collections.Generic.IEnumerable`1[T] orders) [0x0006c] in /home/ari/Development/projects/Lean/Report/PortfolioLooper/PortfolioLooperAlgorithm.cs:45 at (wrapper remoting-invoke-with-check) QuantConnect.Report.PortfolioLooperAlgorithm.FromOrders(System.Collections.Generic.IEnumerable`1<QuantConnect.Orders.Order>) at QuantConnect.Report.PortfolioLooper..ctor (System.Double startingCash, System.Collections.Generic.List`1[T] orders, QuantConnect.Resolution resolution) [0x001ca] in /home/ari/Development/projects/Lean/Report/PortfolioLooper/PortfolioLooper.cs:122 at QuantConnect.Report.PortfolioLooper+<FromOrders>d__13.MoveNext () [0x00283] in /home/ari/Development/projects/Lean/Report/PortfolioLooper/PortfolioLooper.cs:270 at System.Collections.Generic.List`1[T].AddEnumerable (System.Collections.Generic.IEnumerable`1[T] enumerable) [0x00059] in /builddir/build/BUILD/mono-6.12.0.90/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs:1108 at System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) [0x00062] in /builddir/build/BUILD/mono-6.12.0.90/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs:87 at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0000e] in /builddir/build/BUILD/mono-6.12.0.90/external/corefx/src/System.Linq/src/System/Linq/ToCollection.cs:30 at QuantConnect.Report.Report..ctor (System.String name, System.String description, System.String version, QuantConnect.Packets.BacktestResult backtest, QuantConnect.Packets.LiveResult live) [0x00080] in /home/ari/Development/projects/Lean/Report/Report.cs:50 at QuantConnect.Report.Program.Main (System.String[] args) [0x0012c] in /home/ari/Development/projects/Lean/Report/Program.cs:73 [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object at QuantConnect.Securities.SecurityService.CreateSecurity (QuantConnect.Symbol symbol, System.Collections.Generic.List`1[T] subscriptionDataConfigList, System.Decimal leverage, System.Boolean addToSymbolCache) [0x00272] in /home/ari/Development/projects/Lean/Common/Securities/SecurityService.cs:131 at QuantConnect.Securities.SecurityManager.CreateSecurity (QuantConnect.Symbol symbol, System.Collections.Generic.List`1[T] subscriptionDataConfigList, System.Decimal leverage, System.Boolean addToSymbolCache) [0x00001] in /home/ari/Development/projects/Lean/Common/Securities/SecurityManager.cs:302 at QuantConnect.Report.PortfolioLooperAlgorithm.FromOrders (System.Collections.Generic.IEnumerable`1[T] orders) [0x0006c] in /home/ari/Development/projects/Lean/Report/PortfolioLooper/PortfolioLooperAlgorithm.cs:45 at (wrapper remoting-invoke-with-check) QuantConnect.Report.PortfolioLooperAlgorithm.FromOrders(System.Collections.Generic.IEnumerable`1<QuantConnect.Orders.Order>) at QuantConnect.Report.PortfolioLooper..ctor (System.Double startingCash, System.Collections.Generic.List`1[T] orders, QuantConnect.Resolution resolution) [0x001ca] in /home/ari/Development/projects/Lean/Report/PortfolioLooper/PortfolioLooper.cs:122 at QuantConnect.Report.PortfolioLooper+<FromOrders>d__13.MoveNext () [0x00283] in /home/ari/Development/projects/Lean/Report/PortfolioLooper/PortfolioLooper.cs:270 at System.Collections.Generic.List`1[T].AddEnumerable (System.Collections.Generic.IEnumerable`1[T] enumerable) [0x00059] in /builddir/build/BUILD/mono-6.12.0.90/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs:1108 at System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) [0x00062] in /builddir/build/BUILD/mono-6.12.0.90/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs:87 at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0000e] in /builddir/build/BUILD/mono-6.12.0.90/external/corefx/src/System.Linq/src/System/Linq/ToCollection.cs:30 at QuantConnect.Report.Report..ctor (System.String name, System.String description, System.String version, QuantConnect.Packets.BacktestResult backtest, QuantConnect.Packets.LiveResult live) [0x00080] in /home/ari/Development/projects/Lean/Report/Report.cs:50 at QuantConnect.Report.Program.Main (System.String[] args) [0x0012c] in /home/ari/Development/projects/Lean/Report/Program.cs:73

I am up to date with master and am on commit 6cb4411f6e5fde0ad36900cc884a0b1a7f5194a8, tag 981

Author