From: Yuval Kogman Date: Fri, 22 Aug 2008 08:18:26 +0000 (+0000) Subject: HvNAME_get can return NULL X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=db87359d3f4e58404483336b5c1efe1b11bc0ca7;p=gitmo%2FMoose.git HvNAME_get can return NULL --- diff --git a/Moose.xs b/Moose.xs index 84456b3..3f1ae79 100644 --- a/Moose.xs +++ b/Moose.xs @@ -462,8 +462,10 @@ STATIC bool check_sv_type (TC type, SV *sv) { SV *rv = SvRV(sv); if ( SvOBJECT(rv) ) { char *name = HvNAME_get(SvSTASH(SvRV(sv))); - bool is_regexp = strEQ("Regexp", name); - return ( (type == RegexpRef) ^ !is_regexp ); + if ( name ) { + bool is_regexp = strEQ("Regexp", name); + return ( (type == RegexpRef) ^ !is_regexp ); + } } } return 0;