From 0484647aaecdc04485f12d80a8ff31123b89fe23 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Fri, 6 Sep 2024 12:13:18 +0300 Subject: [PATCH] [#115] netmap: Fix type getters * Add type instance check for nil to avoid panic by accessing fields. Signed-off-by: Airat Arifullin --- netmap/types.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netmap/types.go b/netmap/types.go index 1fcdc6e..7821385 100644 --- a/netmap/types.go +++ b/netmap/types.go @@ -335,6 +335,10 @@ func (p *PlacementPolicy) SetContainerBackupFactor(backupFactor uint32) { } func (p *PlacementPolicy) GetReplicas() []Replica { + if p == nil { + return nil + } + return p.replicas }