diff --git a/src/Foundatio/Utility/InstrumentsValues.cs b/src/Foundatio/Utility/InstrumentsValues.cs index 5866f526..922fb2ec 100644 --- a/src/Foundatio/Utility/InstrumentsValues.cs +++ b/src/Foundatio/Utility/InstrumentsValues.cs @@ -24,33 +24,38 @@ public InstrumentsValues(Func<(T1, T2, T3)> readValues) public T1 GetValue1() { if (!_value1.HasValue) - { (_value1, _value2, _value3) = UpdateValues(); - } + + if (_value1 == null) + return default; T1 value = _value1.Value; _value1 = null; return value; + } public T2 GetValue2() { if (!_value2.HasValue) - { (_value1, _value2, _value3) = UpdateValues(); - } + + if (_value2 == null) + return default; T2 value = _value2.Value; _value2 = null; return value; + } public T3 GetValue3() { if (!_value3.HasValue) - { (_value1, _value2, _value3) = UpdateValues(); - } + + if (_value3 == null) + return default; T3 value = _value3.Value; _value3 = null;