diff --git a/Kaitai.Struct.Runtime/ImplicitNullable.cs b/Kaitai.Struct.Runtime/ImplicitNullable.cs index e295856..0b8f235 100644 --- a/Kaitai.Struct.Runtime/ImplicitNullable.cs +++ b/Kaitai.Struct.Runtime/ImplicitNullable.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Text; @@ -7,7 +7,7 @@ namespace Kaitai public struct ImplicitNullable where T : struct { public bool HasValue { get { return this._value.HasValue; } } - public T Value { get { return this._value.Value; } } + public T Value { get { return this._value ?? default; } } public ImplicitNullable(T value) : this() { this._value = value; } public ImplicitNullable(T? value) : this() { this._value = value; }