From 422470fb2ef8962c79b56492b35512a8343141da Mon Sep 17 00:00:00 2001 From: Shaun Wilde Date: Thu, 3 Jan 2019 20:13:04 +1100 Subject: [PATCH] Update CecilSymbolManager.cs handle symbolReader being null --- main/OpenCover.Framework/Symbols/CecilSymbolManager.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main/OpenCover.Framework/Symbols/CecilSymbolManager.cs b/main/OpenCover.Framework/Symbols/CecilSymbolManager.cs index f7c0dd81f..5d8863aaf 100644 --- a/main/OpenCover.Framework/Symbols/CecilSymbolManager.cs +++ b/main/OpenCover.Framework/Symbols/CecilSymbolManager.cs @@ -79,7 +79,15 @@ private void LoadSourceAssembly() { var symbolReader = new DefaultSymbolReaderProvider(true) .GetSymbolReader(_sourceAssembly.MainModule, _sourceAssembly.MainModule.FileName); - _sourceAssembly.MainModule.ReadSymbols(symbolReader); + + if (symbolReader != null) + { + _sourceAssembly.MainModule.ReadSymbols(symbolReader); + } + else + { + _sourceAssembly = null; + } } } catch (FileNotFoundException)