Skip to content

Commit 8947c86

Browse files
committed
Fixed small mistake that made tests fail
1 parent a05515b commit 8947c86

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

RuriLib/Helpers/Blocks/DescriptorsRepository.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,12 @@ private static BlockParameter BuildBlockParameter(ParameterInfo info)
197197
/// </summary>
198198
public static VariableType? ToVariableType(Type type)
199199
{
200-
_variableTypes.TryGetValue(type, out var value);
201-
return value ?? throw new InvalidCastException(
200+
if (_variableTypes.TryGetValue(type, out var value))
201+
{
202+
return value;
203+
}
204+
205+
throw new InvalidCastException(
202206
$"The type {type} could not be casted to VariableType");
203207
}
204208

0 commit comments

Comments
 (0)