diff --git a/main/sched.c b/main/sched.c
index 6a6830b83c871951bd3ea73a3db2360bb0f2dfae..f32cfab920b4c3dbc15ac9047826fdb651714835 100644
--- a/main/sched.c
+++ b/main/sched.c
@@ -377,7 +377,11 @@ int _ast_sched_del(struct sched_context *con, int id, const char *file, int line
 
 	if (!s) {
 		ast_debug(1, "Attempted to delete nonexistent schedule entry %d!\n", id);
+#ifndef DEVMODE
+		ast_assert(s != NULL);
+#else
 		_ast_assert(0, "s != NULL", file, line, function);
+#endif
 		return -1;
 	}