aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'funcs/func_shell.c')
-rw-r--r--funcs/func_shell.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/funcs/func_shell.c b/funcs/func_shell.c
index 9653fcab0..3acafe25a 100644
--- a/funcs/func_shell.c
+++ b/funcs/func_shell.c
@@ -49,7 +49,8 @@ static int shell_helper(struct ast_channel *chan, const char *cmd, char *data,
return -1;
}
- ast_autoservice_start(chan);
+ if (chan)
+ ast_autoservice_start(chan);
if (len >= 1) {
FILE *ptr;
@@ -62,7 +63,8 @@ static int shell_helper(struct ast_channel *chan, const char *cmd, char *data,
pclose(ptr);
}
- ast_autoservice_stop(chan);
+ if (chan)
+ ast_autoservice_stop(chan);
return 0;
}