Skip to content

Commit

Permalink
scheduler: prevent a reported NPE for CSI (#7633)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross authored Apr 6, 2020
1 parent 6021ea6 commit 5af7b0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scheduler/feasible.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 5af7b0f

Please sign in to comment.