From 4656d2b4db0f424b6fe73181fe9ded748f3660b6 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Thu, 16 Apr 2020 16:12:14 +0200 Subject: [PATCH] SSR: fix NPE GitOrigin-RevId: af14c0f5940e629dfc8efb34eeba704f18374387 --- .../intellij/structuralsearch/plugin/ui/ScopePanel.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ScopePanel.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ScopePanel.java index 6815fa54110d..4fc9c468ad73 100644 --- a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ScopePanel.java +++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ScopePanel.java @@ -1,4 +1,4 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.structuralsearch.plugin.ui; import com.intellij.application.options.ModulesComboBox; @@ -182,7 +182,10 @@ public class ScopePanel extends JPanel { } if (!found) { myScopesComboBox.selectItem("Selected Files"); // this scope name is not available in a properties file - myDirectoryComboBox.setDirectory(files[0].getParent()); + final VirtualFile directory = files[0].getParent(); + if (directory != null) { + myDirectoryComboBox.setDirectory(directory); + } } } }