summaryrefslogtreecommitdiff
path: root/funcs/func_odbc.c
diff options
context:
space:
mode:
Diffstat (limited to 'funcs/func_odbc.c')
-rw-r--r--funcs/func_odbc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c
index 4469ca7a2..5e7655f90 100644
--- a/funcs/func_odbc.c
+++ b/funcs/func_odbc.c
@@ -801,6 +801,11 @@ static int acf_fetch(struct ast_channel *chan, const char *cmd, char *data, char
struct odbc_datastore *resultset;
struct odbc_datastore_row *row;
+ if (!chan) {
+ ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
+ return -1;
+ }
+
ast_channel_lock(chan);
store = ast_channel_datastore_find(chan, &odbc_info, data);
if (!store) {