Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit fdc35ba

Browse files
Last fixes for PopupWindow
1 parent ca95c0f commit fdc35ba

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/PopupWindow.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,31 @@ public override void OnEnable()
7272
public override void OnDisable()
7373
{
7474
base.OnDisable();
75-
ActiveView.OnDisable();
75+
76+
if (ActiveView != null)
77+
{
78+
ActiveView.OnDisable();
79+
}
7680
}
7781

7882
public override void OnUI()
7983
{
8084
base.OnUI();
81-
ActiveView.OnGUI();
85+
86+
if (ActiveView != null)
87+
{
88+
ActiveView.OnGUI();
89+
}
8290
}
8391

8492
public override void Refresh()
8593
{
8694
base.Refresh();
87-
ActiveView.Refresh();
95+
96+
if (ActiveView != null)
97+
{
98+
ActiveView.Refresh();
99+
}
88100
}
89101

90102
public override void OnSelectionChange()
@@ -118,10 +130,15 @@ private PopupViewType ActiveViewType
118130
get { return activeViewType; }
119131
set
120132
{
133+
var valueChanged = false;
121134
if (activeViewType != value)
122135
{
136+
valueChanged = true;
123137
activeViewType = value;
138+
}
124139

140+
if (activeView == null || valueChanged)
141+
{
125142
switch (activeViewType)
126143
{
127144
case PopupViewType.PublishView:

0 commit comments

Comments
 (0)