summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/universal.c b/universal.c
index 61a536b7fe..72087e62a8 100644
--- a/universal.c
+++ b/universal.c
@@ -154,9 +154,9 @@ static
XS(XS_UNIVERSAL_class)
{
dXSARGS;
- if(SvROK(ST(0))) {
+ if(SvROK(ST(0)) && SvOBJECT(SvRV(ST(0)))) {
SV *sv = sv_newmortal();
- sv_setpv(sv, HvNAME(SvSTASH(ST(0))));
+ sv_setpv(sv, HvNAME(SvSTASH(SvRV(ST(0)))));
ST(0) = sv;
}
XSRETURN(1);