Skip to content

Commit 69d4836

Browse files
Merge branch 'endgame-202208' into endgame-202208.next
2 parents 16afe24 + bd1953d commit 69d4836

File tree

1 file changed

+9
-7
lines changed
  • PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common

1 file changed

+9
-7
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common/BaseAzureTextInput.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@
2323
import java.util.function.Function;
2424

2525
public class BaseAzureTextInput<T> extends ExtendableTextField
26-
implements AzureFormInputComponent<T>, TextDocumentListenerAdapter {
26+
implements AzureFormInputComponent<T>, TextDocumentListenerAdapter {
2727
protected static final int DEBOUNCE_DELAY = 500;
2828
private final Debouncer debouncer;
2929
private static final Extension VALIDATING = Extension.create(AnimatedIcon.Default.INSTANCE, "Validating...", null);
3030
private static final Extension SUCCESS = Extension.create(AllIcons.General.InspectionsOK, "Validation passed.", null);
3131
private static final Map<AzureValidationInfo.Type, Function<AzureValidationInfo, Extension>> extensions = ImmutableMap.of(
32-
AzureValidationInfo.Type.PENDING, (i) -> VALIDATING,
33-
AzureValidationInfo.Type.SUCCESS, (i) -> SUCCESS,
34-
AzureValidationInfo.Type.ERROR, (i) -> Extension.create(AllIcons.General.BalloonError, i.getMessage(), null),
35-
AzureValidationInfo.Type.WARNING, (i) -> Extension.create(AllIcons.General.BalloonWarning, i.getMessage(), null)
32+
AzureValidationInfo.Type.PENDING, (i) -> VALIDATING,
33+
AzureValidationInfo.Type.SUCCESS, (i) -> SUCCESS,
34+
AzureValidationInfo.Type.ERROR, (i) -> Extension.create(AllIcons.General.BalloonError, i.getMessage(), null),
35+
AzureValidationInfo.Type.WARNING, (i) -> Extension.create(AllIcons.General.BalloonWarning, i.getMessage(), null)
3636
);
3737
protected Extension validationExtension;
3838

@@ -63,12 +63,14 @@ public void onDocumentChanged() {
6363
this.debouncer.debounce();
6464
}
6565

66-
protected synchronized void setValidationExtension(final Extension extension) {
66+
protected synchronized void setValidationExtension(@Nullable final Extension extension) {
6767
AzureTaskManager.getInstance().runLater(() -> {
6868
if (validationExtension != null) {
6969
this.removeExtension(validationExtension);
7070
}
71-
this.addExtension(extension);
71+
if (Objects.nonNull(extension)) {
72+
this.addExtension(extension);
73+
}
7274
this.validationExtension = extension;
7375
}, AzureTask.Modality.ANY);
7476
}

0 commit comments

Comments
 (0)