Skip to content

Commit b2f27e8

Browse files
committed
Mitigated validation bug with recent Move() bug fix
When fixing the missing implementation of the basic `Move()` overload (d7a61cd), I failed to take into account that `SetParent()` validates that the sibling is not null. Perhaps we should align the logic of `SetParent()` to behave like `Move()` where `sibling` can be `null`. In the meanwhile, however, it's easy to workaround.
1 parent f980ef8 commit b2f27e8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

OnTopic/Repositories/TopicRepositoryBase.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,12 @@ public virtual void Move([ValidatedNotNull]Topic topic, [ValidatedNotNull]Topic
423423
\-----------------------------------------------------------------------------------------------------------------------*/
424424
var previousParent = topic.Parent;
425425
MoveEvent?.Invoke(this, new MoveEventArgs(topic, target));
426-
topic.SetParent(target, sibling);
426+
if (sibling == null) {
427+
topic.SetParent(target);
428+
}
429+
else {
430+
topic.SetParent(target, sibling);
431+
}
427432

428433
/*------------------------------------------------------------------------------------------------------------------------
429434
| If a content type descriptor is being moved to a new parent, refresh cache

0 commit comments

Comments
 (0)