Skip to content

Commit d956095

Browse files
authored
Fix npe when pop up survey window (#3646)
1 parent a002181 commit d956095

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azuretools/ijidea/ui/SurveyPopUpDialog.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ public void mouseExited(MouseEvent e) {
167167
private void setLocationRelativeToIDE(Project project) {
168168
project = project != null ? project : ProjectManagerImpl.getInstance().getOpenProjects()[0];
169169
JFrame ideFrame = WindowManagerImpl.getInstance().getFrame(project);
170+
if (ideFrame == null) {
171+
// In case user close project after start up
172+
ideFrame = WindowManagerImpl.getInstance().findVisibleFrame();
173+
}
170174
int locationX = ideFrame.getX() + ideFrame.getWidth() - this.getWidth();
171175
int locationY = ideFrame.getY() + ideFrame.getHeight() - this.getHeight();
172176
this.setLocation(locationX, locationY);

0 commit comments

Comments
 (0)