diff --git a/GlazeWM.Domain/Containers/CommandHandlers/DetachContainerHandler.cs b/GlazeWM.Domain/Containers/CommandHandlers/DetachContainerHandler.cs index 6bd664172..355c50612 100644 --- a/GlazeWM.Domain/Containers/CommandHandlers/DetachContainerHandler.cs +++ b/GlazeWM.Domain/Containers/CommandHandlers/DetachContainerHandler.cs @@ -75,8 +75,8 @@ public CommandResponse Handle(DetachContainerCommand command) _bus.Invoke( new FlattenSplitContainerCommand(detachedSiblings.ElementAt(0) as SplitContainer) ); - - _bus.Invoke(new FlattenSplitContainerCommand(detachedParent as SplitContainer)); + if (detachedParent is not Workspace) + _bus.Invoke(new FlattenSplitContainerCommand(detachedParent as SplitContainer)); } return CommandResponse.Ok;