From 81b48ff19b416f7c6fc5bb3476a230325ad96518 Mon Sep 17 00:00:00 2001 From: Yannick Marcon Date: Sat, 25 Jan 2025 11:30:08 +0100 Subject: [PATCH] fix: case parent file is null --- .../src/main/java/org/obiba/opal/web/FilesResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opal-core-ws/src/main/java/org/obiba/opal/web/FilesResource.java b/opal-core-ws/src/main/java/org/obiba/opal/web/FilesResource.java index 8cbb0c69b0..cc99f225ea 100644 --- a/opal-core-ws/src/main/java/org/obiba/opal/web/FilesResource.java +++ b/opal-core-ws/src/main/java/org/obiba/opal/web/FilesResource.java @@ -97,7 +97,7 @@ public Response getFileSystemRootDetails() throws IOException { @NoAuthorization public Response getFileDetails(@PathParam("path") String path) throws IOException { FileObject file = resolveFileInFileSystem(path); - if (!file.getParent().isReadable() || !file.exists()) { + if (file.getParent() != null && !file.getParent().isReadable() || !file.exists()) { return getPathNotExistResponse("/" + path); } if (file.getType() == FileType.FILE) {