diff --git a/funcs/func_audiohookinherit.c b/funcs/func_audiohookinherit.c
index f3a5b61892b81c18be4df7be8561744bcc2c5851..ea5c5e9ab66d2d4a67e2bd90a247338104b43d91 100644
--- a/funcs/func_audiohookinherit.c
+++ b/funcs/func_audiohookinherit.c
@@ -228,6 +228,11 @@ static int func_inheritance_write(struct ast_channel *chan, const char *function
 		return -1;
 	}
 
+	if (!chan) {
+		ast_log(LOG_WARNING, "No channel was provided to INHERITANCE function.\n");
+		return -1;
+	}
+
 	allow = ast_true(value);
 
 	/* Step 2: retrieve or set up datastore */