summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mg.c b/mg.c
index 82f63c007d..830e0396ff 100644
--- a/mg.c
+++ b/mg.c
@@ -1053,7 +1053,7 @@ Perl_magic_setenv(pTHX_ SV *sv, MAGIC *mg)
if (!len) {
SV ** const valp = hv_fetch(GvHVn(PL_envgv), ptr, klen, FALSE);
if (valp)
- s = SvPV_const(*valp, len);
+ s = SvOK(*valp) ? SvPV_const(*valp, len) : "";
}
#endif