Skip to content
This repository was archived by the owner on Aug 16, 2022. It is now read-only.

Commit 358237b

Browse files
authored
fix: property fields in a property list cannot be removed (#160)
* fix * fix pr comments
1 parent 62dede2 commit 358237b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pkg/property/pointer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func (p *Pointer) Test(sg SchemaGroupID, i ItemID, f FieldID) bool {
216216
}
217217

218218
func (p *Pointer) TestItem(sg SchemaGroupID, i ItemID) bool {
219-
return p.TestSchemaGroup(sg) && (p.item == nil || *p.item == i)
219+
return p.TestSchemaGroup(sg) && (p.item == nil || p.item.Equal(i))
220220
}
221221

222222
func (p *Pointer) TestSchemaGroup(sg SchemaGroupID) bool {

pkg/property/property.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,11 @@ func (p *Property) RemoveField(ptr *Pointer) {
266266
return
267267
}
268268

269-
if group := ToGroup(p.Item(ptr)); group != nil {
269+
item := p.Item(ptr)
270+
if group := ToGroup(item); group != nil {
270271
group.RemoveField(fid)
272+
} else if groupList := ToGroupList(item); groupList != nil {
273+
groupList.RemoveFields(ptr)
271274
}
272275
}
273276

0 commit comments

Comments
 (0)