Skip to content

Commit

Permalink
fix: Fixed NPE while getting the ReplicaSet labels
Browse files Browse the repository at this point in the history
Signed-off-by: Rohit Agrawal <[email protected]>
  • Loading branch information
agrawroh committed Nov 18, 2021
1 parent 6edc9c8 commit 2572a7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/replicaset/replicaset.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ func PodTemplateEqualIgnoreHash(live, desired *corev1.PodTemplateSpec) bool {

// GetPodTemplateHash returns the rollouts-pod-template-hash value from a ReplicaSet's labels
func GetPodTemplateHash(rs *appsv1.ReplicaSet) string {
if rs.Labels == nil {
if rs == nil || rs.Labels == nil {
return ""
}
return rs.Labels[v1alpha1.DefaultRolloutUniqueLabelKey]
Expand Down

0 comments on commit 2572a7a

Please sign in to comment.