Skip to content

Commit

Permalink
Avoid NullPointerException on rakudo.jvm
Browse files Browse the repository at this point in the history
'say my @A' lead to NPE; timotimo++ for suggesting nqp::existskey
  • Loading branch information
usev6 committed Nov 28, 2015
1 parent 474db4c commit 632f75b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Mu.pm
Expand Up @@ -342,7 +342,7 @@ Please refactor this code using the new Iterator / Seq interface.
method gistseen(Mu:D \SELF: $id, $gist, *%named) {
if $*gistseen -> \sems {
my str $WHICH = nqp::unbox_s(self.WHICH);
if nqp::atkey(sems,$WHICH) {
if nqp::existskey(sems,$WHICH) && nqp::atkey(sems,$WHICH) {
nqp::bindkey(sems,$WHICH,2);
"{$id}_{nqp::objectid(SELF)}";
}
Expand All @@ -369,7 +369,7 @@ Please refactor this code using the new Iterator / Seq interface.
method perlseen(Mu:D \SELF: $id, $perl, *%named) {
if $*perlseen -> \sems {
my str $WHICH = nqp::unbox_s(self.WHICH);
if nqp::atkey(sems,$WHICH) {
if nqp::existskey(sems,$WHICH) && nqp::atkey(sems,$WHICH) {
nqp::bindkey(sems,$WHICH,2);
"{$id}_{nqp::objectid(SELF)}";
}
Expand Down

0 comments on commit 632f75b

Please sign in to comment.