From 6d2d18bc50ad8101bb7e1459cdf99c984bdf9cb0 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 24 Apr 2017 17:35:10 +0300 Subject: [PATCH] IDEA-165089 improve validation for empty name of schemes --- .../application/options/schemes/EditableSchemesCombo.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/application/options/schemes/EditableSchemesCombo.java b/platform/platform-impl/src/com/intellij/application/options/schemes/EditableSchemesCombo.java index 505994078377..87220b8fc5fd 100644 --- a/platform/platform-impl/src/com/intellij/application/options/schemes/EditableSchemesCombo.java +++ b/platform/platform-impl/src/com/intellij/application/options/schemes/EditableSchemesCombo.java @@ -32,6 +32,8 @@ import java.awt.event.*; import java.util.Collection; import java.util.function.Consumer; +import static com.intellij.openapi.util.text.StringUtil.isEmptyOrSpaces; + public class EditableSchemesCombo { // region Message constants @@ -210,7 +212,7 @@ public class EditableSchemesCombo { @Nullable private String validateSchemeName(@NotNull String name, boolean isProjectScheme) { if (myNameEditData != null && name.equals(myNameEditData.initialName)) return null; - if (name.isEmpty()) { + if (isEmptyOrSpaces(name)) { return EMPTY_NAME_MESSAGE; } else if (mySchemesPanel.getModel().containsScheme(name, isProjectScheme)) {