瀏覽代碼

Fixed null value crash on MultiSignaturePadProperties.Default when opening forms

Frank vandenBos 5 天之前
父節點
當前提交
841cd29b42

+ 7 - 2
InABox.Core/DigitalForms/Layouts/Fields/DFLayoutMultiSignaturePad/DFLayoutMultiSignaturePadProperties.cs

@@ -7,11 +7,16 @@ namespace InABox.Core
 {
 {
     public class DFLayoutMultiSignaturePadProperties : DFLayoutFieldProperties<Dictionary<string, byte[]>, Dictionary<string, byte[]>?>
     public class DFLayoutMultiSignaturePadProperties : DFLayoutFieldProperties<Dictionary<string, byte[]>, Dictionary<string, byte[]>?>
     {
     {
+        private Dictionary<string, byte[]> _default = new Dictionary<string, byte[]>();
 
 
         [EditorSequence(-995)]
         [EditorSequence(-995)]
         [NullEditor]
         [NullEditor]
-        public override Dictionary<string, byte[]> Default { get; set; } = new Dictionary<string, byte[]>();
-        
+        public override Dictionary<string, byte[]> Default
+        {
+            get => _default;
+            set => _default = value ?? new Dictionary<string, byte[]>();
+        }
+
         public override string FormatValue(Dictionary<string, byte[]>? value)
         public override string FormatValue(Dictionary<string, byte[]>? value)
         {
         {
             return value != null ? "Yes" : "";
             return value != null ? "Yes" : "";