Skip to content

Commit

Permalink
Fixed small mistake that made tests fail
Browse files Browse the repository at this point in the history
  • Loading branch information
openbullet committed Dec 15, 2024
1 parent a05515b commit 8947c86
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions RuriLib/Helpers/Blocks/DescriptorsRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,12 @@ private static BlockParameter BuildBlockParameter(ParameterInfo info)
/// </summary>
public static VariableType? ToVariableType(Type type)
{
_variableTypes.TryGetValue(type, out var value);
return value ?? throw new InvalidCastException(
if (_variableTypes.TryGetValue(type, out var value))
{
return value;
}

throw new InvalidCastException(
$"The type {type} could not be casted to VariableType");
}

Expand Down

0 comments on commit 8947c86

Please sign in to comment.