From 11d065ff30ddddbb1eca17584af65a7240f3a745 Mon Sep 17 00:00:00 2001 From: kianzzarrin Date: Tue, 4 Oct 2022 21:57:58 +0300 Subject: [PATCH] null guard --- LoadOrder/CO/Plugins/PluginManger.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LoadOrder/CO/Plugins/PluginManger.cs b/LoadOrder/CO/Plugins/PluginManger.cs index 5f3a0e8..6aced1c 100644 --- a/LoadOrder/CO/Plugins/PluginManger.cs +++ b/LoadOrder/CO/Plugins/PluginManger.cs @@ -113,7 +113,8 @@ public class PluginInfo : IWSItem { if (modName.IsNullorEmpty()) { displayText_ = DispalyPath; } else { - displayText_ = $"{modName} ({DispalyPath} V{UserModAssemblyVersion})"; + string version = UserModAssemblyVersion == null ? "" : "V" + UserModAssemblyVersion; + displayText_ = $"{modName} ({DispalyPath} {version})"; } } return displayText_; @@ -417,7 +418,7 @@ public class PluginInfo : IWSItem { public TypeDefinition userModImplementation => m_UserModImplementation ??= GetImplementation(PluginManager.kUserMod); - public Version UserModAssemblyVersion => userModImplementation.Module.Assembly.Name.Version; + public Version UserModAssemblyVersion => userModImplementation?.Module?.Assembly?.Name?.Version ?? default; public TypeDefinition GetImplementation(string fullInterfaceName) => AssemblyUtil.FindImplementation(DllPaths, fullInterfaceName, out dllPath_);