diff --git a/src/pmc/p6invocation.pmc b/src/pmc/p6invocation.pmc index 6fcfa434ba3..548fbc526bd 100644 --- a/src/pmc/p6invocation.pmc +++ b/src/pmc/p6invocation.pmc @@ -220,6 +220,8 @@ pmclass P6Invocation need_ext dynpmc group perl6_group { SETATTR_P6Invocation_first_candidate(interp, SELF, PMCNULL); /* Invoke it, then fudge ourself into its lexpad. */ + if (PMC_IS_NULL(first_candidate)) + Parrot_ex_throw_from_c_args(interp, next, 1, "No candidates found to invoke"); addr = VTABLE_invoke(interp, first_candidate, next); lexpad = CONTEXT(interp)->lex_pad; if (!PMC_IS_NULL(lexpad) && VTABLE_exists_keyed_str(interp, lexpad, lexname))