Prevent NPE when service lacks identity (#19987)

Fixes a null pointer exception if `Alloc.SignIdentities` was called for
any service and any service lacked an identity.

Fixes #19986
This commit is contained in:
Soren L. Hansen
2024-02-22 06:01:06 -08:00
committed by GitHub
parent cce72cddfd
commit 14280e0820
2 changed files with 7 additions and 1 deletions

3
.changelog/19986.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:bug
server: Prevent NPE when service lacks identity
```

View File

@@ -312,7 +312,10 @@ type WIHandle struct {
WorkloadType WorkloadType
}
func (w WIHandle) Equal(o WIHandle) bool {
func (w *WIHandle) Equal(o WIHandle) bool {
if w == nil {
return false
}
return w.IdentityName == o.IdentityName &&
w.WorkloadIdentifier == o.WorkloadIdentifier &&
w.WorkloadType == o.WorkloadType