diff --git a/src/perl.c b/src/perl.c
index 5aa96c355b2494ace34fc361c42197f0df3cb0a6..67cb842b0b06f0c42332f4ee999e5fd45a91aac1 100644 (file)
--- a/src/perl.c
+++ b/src/perl.c
values = ST (/* stack index = */ 0);
+ if (NULL == values)
+ XSRETURN_EMPTY;
+
/* Make sure the argument is a hash reference. */
if (! (SvROK (values) && (SVt_PVHV == SvTYPE (SvRV (values))))) {
log_err ("Collectd::plugin_dispatch_values: Invalid values.");
XSRETURN_EMPTY;
}
- if (NULL == values)
- XSRETURN_EMPTY;
-
ret = pplugin_dispatch_values (aTHX_ (HV *)SvRV (values));
if (0 == ret)