Unverified Commit 5af7b0fe authored by Tim Gross's avatar Tim Gross Committed by GitHub
Browse files

scheduler: prevent a reported NPE for CSI (#7633)

parent 6021ea6d
Showing with 1 addition and 1 deletion
+1 -1
......@@ -304,7 +304,7 @@ func (c *CSIVolumeChecker) hasPlugins(n *structs.Node) (bool, string) {
// Check the blocking allocations to see if they belong to this job
for id := range vol.WriteAllocs {
a, err := c.ctx.State().AllocByID(ws, id)
if err != nil || a.Namespace != c.namespace || a.JobID != c.jobID {
if err != nil || a == nil || a.Namespace != c.namespace || a.JobID != c.jobID {
return false, fmt.Sprintf(FilterConstraintCSIVolumeInUseTemplate, vol.ID)
}
}
......
Supports Markdown
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