From 6e3d465c4ce79fccd453881c28fc443d171d9048 Mon Sep 17 00:00:00 2001 From: Glavo Date: Wed, 4 Oct 2023 14:40:33 +0800 Subject: [PATCH] update --- .../org/fusesource/jansi/internal/NativeImageFeature.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/fusesource/jansi/internal/NativeImageFeature.java b/src/main/java/org/fusesource/jansi/internal/NativeImageFeature.java index 2c401104..27063a11 100644 --- a/src/main/java/org/fusesource/jansi/internal/NativeImageFeature.java +++ b/src/main/java/org/fusesource/jansi/internal/NativeImageFeature.java @@ -15,6 +15,8 @@ */ package org.fusesource.jansi.internal; +import java.util.Objects; + import org.fusesource.jansi.AnsiConsole; import org.graalvm.nativeimage.hosted.Feature; import org.graalvm.nativeimage.hosted.RuntimeClassInitialization; @@ -40,9 +42,8 @@ public void duringSetup(DuringSetupAccess access) { } } - String provider = AnsiConsoleSupportHolder.getProviderName(); - - if (provider == null || provider.equals(AnsiConsole.JANSI_PROVIDER_JNI)) { + String provider = Objects.requireNonNull(AnsiConsoleSupportHolder.getProviderName(), "No provider available"); + if (provider.equals(AnsiConsole.JANSI_PROVIDER_JNI)) { String jansiNativeLibraryName = System.mapLibraryName("jansi"); if (jansiNativeLibraryName.endsWith(".dylib")) { jansiNativeLibraryName = jansiNativeLibraryName.replace(".dylib", ".jnilib");