mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-25 19:38:37 +08:00
safer cast and value access when creating float window
This commit is contained in:
@@ -33,7 +33,9 @@
|
||||
{
|
||||
public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
|
||||
{
|
||||
return new FloatWindowNG(dockPanel, pane, ((ConnectionTab)dockPanel.ActiveDocument).Bounds);
|
||||
var activeDocumentBounds = (dockPanel?.ActiveDocument as ConnectionTab)?.Bounds;
|
||||
|
||||
return new FloatWindowNG(dockPanel, pane, activeDocumentBounds ?? bounds);
|
||||
}
|
||||
|
||||
public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane)
|
||||
|
||||
Reference in New Issue
Block a user