Skip to content

Commit 92a85ed

Browse files
committed
Fix NullReferenceException accessing Value.
1 parent 7c10982 commit 92a85ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Kaitai.Struct.Runtime/ImplicitNullable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Kaitai
77
public struct ImplicitNullable<T> where T : struct
88
{
99
public bool HasValue { get { return this._value.HasValue; } }
10-
public T Value { get { return this._value.Value; } }
10+
public T Value { get => this._value ?? default; }
1111

1212
public ImplicitNullable(T value) : this() { this._value = value; }
1313
public ImplicitNullable(T? value) : this() { this._value = value; }

0 commit comments

Comments
 (0)