diff --git a/pkg/hints/usort_hints.go b/pkg/hints/usort_hints.go index 3d0a5d75..ba1d0c67 100644 --- a/pkg/hints/usort_hints.go +++ b/pkg/hints/usort_hints.go @@ -3,6 +3,7 @@ package hints import ( "github.com/lambdaclass/cairo-vm.go/pkg/lambdaworks" "github.com/lambdaclass/cairo-vm.go/pkg/types" + "github.com/pkg/errors" ) // Implements hint: @@ -10,7 +11,11 @@ import ( func usort_enter_scope(executionScopes *types.ExecutionScopes) error { usort_max_size, err := executionScopes.Get("usort_max_size") - usort_max_size_felt := usort_max_size.(lambdaworks.Felt) + usort_max_size_felt, cast_ok := usort_max_size.(lambdaworks.Felt) + + if !cast_ok { + return errors.New("Error casting usort_max_size into a Felt") + } if err != nil { return err