safer cast and value access when creating float window

This commit is contained in:
David Sparer
2019-01-10 10:22:00 -06:00
parent cc184b7c58
commit f56f1160ba

View File

@@ -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)