fix(docking): improve structural integrity and add null validation

This commit is contained in:
2026-03-28 22:35:43 +09:00
parent e5aa328576
commit 1d48784a1c
3 changed files with 47 additions and 5 deletions

View File

@@ -72,6 +72,8 @@ public class DockingLayout : Control
/// <param name="targetGroup">The target group to add the document to. If null, a suitable group will be found or created.</param>
public void AddDocument(DockDocument document, DockTarget target, DockGroup? targetGroup = null)
{
ArgumentNullException.ThrowIfNull(document);
if (targetGroup != null && targetGroup.Root != this)
{
throw new ArgumentException("targetGroup does not belong to this DockingLayout");