Gracefully handle cached assignment with no policy found

parent c534480b
......@@ -642,6 +642,11 @@ get_policy(VRT_CTX, const struct vmod_priv * restrict const priv_task,
return task->policy;
}
if (task->assignment == NULL) {
VERR(ctx, "%s.%s() no policy", vcl_name, method);
return NULL;
}
CHECK_OBJ_NOTNULL(task->assignment, VMOD_HOAILONA_ASSIGNMENT_MAGIC);
CHECK_OBJ_NOTNULL(task->assignment->policy, VMOD_HOAILONA_POLICY_MAGIC);
return task->assignment->policy;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment