summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-01-03 21:19:16 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-01-03 21:19:16 +0000
commitcffe29818d69c7ccd4bfbfe7e002dc05573451ca (patch)
tree976bd21d7350c3f80c0e4212287cc387287820bf
parenta72f7244ff581edbeb4f8552eba92bbb6ee09ba8 (diff)
downloadirssi-cffe29818d69c7ccd4bfbfe7e002dc05573451ca.zip
Irssi::signal_emit() - make sure the parameter is a reference before trying
to unreference it. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2291 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--src/perl/common/Core.xs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/perl/common/Core.xs b/src/perl/common/Core.xs
index 26e085cc..ea47e684 100644
--- a/src/perl/common/Core.xs
+++ b/src/perl/common/Core.xs
@@ -32,8 +32,10 @@ CODE:
p[n-1] = SvPV(ST(n), PL_na);
else if (irssi_is_ref_object(ST(n)))
p[n-1] = irssi_ref_object(ST(n));
- else
+ else if (SvROK(ST(n)))
p[n-1] = (void *) SvIV((SV*)SvRV(ST(n)));
+ else
+ p[n-1] = NULL;
}
signal_emit(signal, items-1, p[0], p[1], p[2], p[3], p[4], p[5]);