Skip to content

Commit

Permalink
null guard
Browse files Browse the repository at this point in the history
  • Loading branch information
kianzarrin committed Oct 4, 2022
1 parent b49abd0 commit 11d065f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions LoadOrder/CO/Plugins/PluginManger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down Expand Up @@ -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_);
Expand Down

0 comments on commit 11d065f

Please sign in to comment.