blobref: Equal on nils

Change-Id: Idb6a2ba14a4e92b2b619e5cce87174bf80f2090f
This commit is contained in:
Brad Fitzpatrick 2011-12-01 17:28:05 -08:00
parent 476329cfb3
commit f7ab48b0d8
1 changed files with 6 additions and 0 deletions

View File

@ -106,6 +106,12 @@ func (b *BlobRef) DomID() string {
} }
func (o *BlobRef) Equal(other *BlobRef) bool { func (o *BlobRef) Equal(other *BlobRef) bool {
if (o == nil) != (other == nil) {
return false
}
if o == nil {
return true
}
return o.hashName == other.hashName && o.digest == other.digest return o.hashName == other.hashName && o.digest == other.digest
} }