From 93f7f11d24ab2fe0e79bf66c7e3c175a71a37d69 Mon Sep 17 00:00:00 2001 From: Yi Li Date: Tue, 4 Nov 2025 16:51:16 -0800 Subject: [PATCH] Allow toStandardizedURIString to handle null value gracefully. Signed-off-by: Yi Li --- .../io/unitycatalog/server/persist/utils/FileOperations.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/io/unitycatalog/server/persist/utils/FileOperations.java b/server/src/main/java/io/unitycatalog/server/persist/utils/FileOperations.java index c8ffa225a8..c5312cef91 100644 --- a/server/src/main/java/io/unitycatalog/server/persist/utils/FileOperations.java +++ b/server/src/main/java/io/unitycatalog/server/persist/utils/FileOperations.java @@ -216,7 +216,7 @@ public static void assertValidLocation(String location) { * the input as a local file path and converts it to a "file://" URI. * * @param inputPath the input path or URI to be standardized. - * @return the standardized URI string. + * @return the standardized URI string, or null if inputPath is null. * @throws BaseException if the input path has an unsupported URI scheme. *

Examples of input and output: *

@@ -241,6 +241,9 @@ public static void assertValidLocation(String location) {
    * 
*/ public static String toStandardizedURIString(String inputPath) { + if (inputPath == null) { + return null; + } // Check if the path is already a URI with a valid scheme URI uri; try {