Skip to content

Commit

Permalink
Add missing checks for nulls
Browse files Browse the repository at this point in the history
Some were overlooked and some I thought wouldn't be needed.

Related to PDF failure in #4705.
  • Loading branch information
vrurg committed Jan 10, 2022
1 parent 254d152 commit 821195b
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions src/Perl6/Metamodel/ParametricRoleGroupHOW.nqp
Expand Up @@ -176,38 +176,45 @@ class Perl6::Metamodel::ParametricRoleGroupHOW
method candidates($obj) { nqp::clone(@!candidates) }

method lookup($obj, $name) {
my $c := self.'!get_default_candidate'();
$c.HOW.lookup($c, $name);
nqp::isnull(my $c := self.'!get_default_candidate'())
?? []
!! $c.HOW.lookup($c, $name);
}

method methods($obj, *@pos, *%name) {
my $c := self.'!get_default_candidate'();
$c.HOW.methods($c, |@pos, |%name);
nqp::isnull(my $c := self.'!get_default_candidate'())
?? []
!! $c.HOW.methods($c, |@pos, |%name);
}

method attributes($obj, *@pos, *%name) {
my $c := self.'!get_default_candidate'();
$c.HOW.attributes($c, |@pos, |%name);
nqp::isnull(my $c := self.'!get_default_candidate'())
?? []
!! $c.HOW.attributes($c, |@pos, |%name);
}

method parents($obj, *%named) {
my $c := self.'!get_default_candidate'();
$c.HOW.parents($c, |%named)
nqp::isnull(my $c := self.'!get_default_candidate'())
?? []
!! $c.HOW.parents($c, |%named)
}

method roles($obj, *%named) {
my $c := self.'!get_default_candidate'();
$c.HOW.roles($c, |%named)
nqp::isnull(my $c := self.'!get_default_candidate'())
?? []
!! $c.HOW.roles($c, |%named)
}

method ver($obj) {
my $c := self.'!get_default_candidate'();
$c.HOW.ver($c)
nqp::isnull(my $c := self.'!get_default_candidate'())
?? nqp::null()
!! $c.HOW.ver($c)
}

method auth($obj) {
my $c := self.'!get_default_candidate'();
$c.HOW.auth($c)
nqp::isnull(my $c := self.'!get_default_candidate'())
?? nqp::null()
!! $c.HOW.auth($c)
}

method language-revision($obj) {
Expand Down

0 comments on commit 821195b

Please sign in to comment.