From 6b30a6d6b25ee1117f2838dec37cc0033d7c024c Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Mon, 9 Nov 2015 02:12:15 +0300 Subject: [PATCH] It seems that GetEntryAssembly might return null --- src/Skia/Perspex.Skia.Desktop/MethodTableImpl.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Skia/Perspex.Skia.Desktop/MethodTableImpl.cs b/src/Skia/Perspex.Skia.Desktop/MethodTableImpl.cs index e6d893d8ea..3a1014eb2b 100644 --- a/src/Skia/Perspex.Skia.Desktop/MethodTableImpl.cs +++ b/src/Skia/Perspex.Skia.Desktop/MethodTableImpl.cs @@ -79,9 +79,11 @@ namespace Perspex.Skia foreach ( var basePath in new[] {Assembly.GetEntryAssembly(), typeof (MethodTable).Assembly}.Select( - a => Path.GetDirectoryName(a.GetModules()[0].FullyQualifiedName)) + a => Path.GetDirectoryName(a?.GetModules()?[0]?.FullyQualifiedName)) .Concat(new[] { Directory.GetCurrentDirectory()})) { + if(basePath == null) + continue; yield return Path.Combine(basePath); yield return Path.Combine(basePath, "native"); yield return Path.Combine(basePath, "lib");