From: Peter Rabbitson Date: Sun, 19 Dec 2010 01:25:01 +0000 (+0000) Subject: Silence warnings in case the expected shim gets garbage collected before any calls X-Git-Tag: v0.10002~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=45c3ca9b593b39c628b186bb0cce26d745db2c24;hp=b36cd2595cc422d4e5bb0d5e905acfd7d4c1fd70;p=p5sagit%2FClass-Accessor-Grouped.git Silence warnings in case the expected shim gets garbage collected before any calls --- diff --git a/lib/Class/Accessor/Grouped.pm b/lib/Class/Accessor/Grouped.pm index aea38c2..74801f8 100644 --- a/lib/Class/Accessor/Grouped.pm +++ b/lib/Class/Accessor/Grouped.pm @@ -689,7 +689,7 @@ $gen_accessor = sub { # if after this shim was created someone wrapped it with an 'around', # we can not blindly reinstall the method slot - we will destroy the # wrapper. Silently chain execution further... - if ($expected_cref != $current_class->can($methname)) { + if ( !$expected_cref or $expected_cref != $current_class->can($methname) ) { # there is no point in re-determining it on every subsequent call, # just store for future reference