forked from TrueCloudLab/frostfs-api-go
object: prevent potential NPE panic in PutRequest.CID method
This commit is contained in:
parent
908e0f3c8f
commit
e999110be1
2 changed files with 5 additions and 1 deletions
|
@ -127,7 +127,9 @@ func (m *PutRequest) NotFull() bool { return checkIsNotFull(m) }
|
|||
// CID returns container id value from object put request.
|
||||
func (m *PutRequest) CID() CID {
|
||||
if header := m.GetHeader(); header != nil {
|
||||
return header.Object.SystemHeader.CID
|
||||
if obj := header.GetObject(); obj != nil {
|
||||
return obj.SystemHeader.CID
|
||||
}
|
||||
}
|
||||
return refs.CID{}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue