Skip to content

Commit 0d4834f

Browse files
aalexandruaalexand
andauthored
fix: cluster-registry-sync-manager nil pointer dereference (#219)
Co-authored-by: aalexand <[email protected]>
1 parent 89bb6fd commit 0d4834f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/sync/manager/controller.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,12 @@ func (c *SyncController) hasDifferentHash(object runtime.Object) bool {
325325
instance := object.(*registryv1alpha1.ClusterSync)
326326

327327
oldHash := instance.Status.SyncedDataHash
328-
newHash := ptr.To(hash(instance.Status.SyncedData))
329328

330-
return *oldHash != *newHash
329+
if oldHash == nil || instance.Status.SyncedData == nil {
330+
return true
331+
}
332+
333+
return *oldHash != hash(instance.Status.SyncedData)
331334
}
332335

333336
func (c *SyncController) updateStatus(ctx context.Context, instance *registryv1alpha1.ClusterSync) error {

0 commit comments

Comments
 (0)