Skip to content
This repository was archived by the owner on May 9, 2025. It is now read-only.

Commit 849a796

Browse files
Fixed reference throwing null refs if it hasn't been initialized through the inspector
1 parent b98a801 commit 849a796

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Assets/SO Architecture/References/BaseReference.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ public BaseReference(TBase baseValue)
1919

2020
public TBase Value
2121
{
22-
get { return _useConstant ? _constantValue : _variable.Value; }
22+
get
23+
{
24+
return (_useConstant || _variable == null) ? _constantValue : _variable.Value;
25+
}
2326
set
2427
{
2528
if (!_useConstant && _variable != null)

0 commit comments

Comments
 (0)