From ffbb14fd0d76ed6dab799b7268e4d0af8a3ee9b1 Mon Sep 17 00:00:00 2001 From: js6pak Date: Thu, 14 Jan 2021 18:01:02 +0100 Subject: [PATCH] Fix BepInDependency cache --- BepInEx.Core/Contract/Attributes.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BepInEx.Core/Contract/Attributes.cs b/BepInEx.Core/Contract/Attributes.cs index f18ff3f7..cc442f26 100644 --- a/BepInEx.Core/Contract/Attributes.cs +++ b/BepInEx.Core/Contract/Attributes.cs @@ -150,14 +150,16 @@ void ICacheable.Save(BinaryWriter bw) { bw.Write(DependencyGUID); bw.Write((int)Flags); - bw.Write(VersionRange.ToString()); + bw.Write(VersionRange?.ToString() ?? string.Empty); } void ICacheable.Load(BinaryReader br) { DependencyGUID = br.ReadString(); Flags = (DependencyFlags)br.ReadInt32(); - VersionRange = SemVer.Range.Parse(br.ReadString()); + + var versionRange = br.ReadString(); + VersionRange = versionRange == string.Empty ? null : SemVer.Range.Parse(versionRange); } }