summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/res_snmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_snmp.c b/res/res_snmp.c
index 2ccadc407..cbca08a41 100644
--- a/res/res_snmp.c
+++ b/res/res_snmp.c
@@ -106,7 +106,7 @@ static int unload_module(void)
ast_verbose(VERBOSE_PREFIX_1 "Unloading [Sub]Agent Module\n");
res_snmp_dont_stop = 0;
- return pthread_join(thread, NULL);
+ return ((thread != AST_PTHREADT_NULL) ? pthread_join(thread, NULL) : 0);
}
static int reload(void)