From f3adb736c06f17f446f696b9c208fb5532ffcbc1 Mon Sep 17 00:00:00 2001 From: Artem Kolosov Date: Thu, 2 Jun 2022 11:43:25 +0700 Subject: [PATCH] Upstream fix: stop Mutable section from setting MutableProperty with null Value. It was messing up getting a Size property of a Mutable Section, as it reads the MutableProperty's Value and tries to get it's length, throwing exception. --- main/HPSF/MutableSection.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/HPSF/MutableSection.cs b/main/HPSF/MutableSection.cs index 6f7407fa7..aed706511 100644 --- a/main/HPSF/MutableSection.cs +++ b/main/HPSF/MutableSection.cs @@ -230,7 +230,10 @@ public void SetProperty(Property p) { long id = p.ID; RemoveProperty(id); - preprops.Add(p); + if (p.Value != null) + { + preprops.Add(p); + } dirty = true; }