[#115] netmap: Fix type getters
All checks were successful
DCO action / DCO (pull_request) Successful in 39s
Tests and linters / Lint (pull_request) Successful in 44s
Tests and linters / Tests (pull_request) Successful in 48s
Tests and linters / Tests with -race (pull_request) Successful in 1m11s

* Add type instance check for nil to avoid panic by
  accessing fields.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
Airat Arifullin 2024-09-06 12:13:18 +03:00
parent 8f268ad512
commit 5e82e8c776

View file

@ -335,6 +335,10 @@ func (p *PlacementPolicy) SetContainerBackupFactor(backupFactor uint32) {
}
func (p *PlacementPolicy) GetReplicas() []Replica {
if p == nil {
return nil
}
return p.replicas
}