Skip to content

Commit 85c63a5

Browse files
committed
fix: fix to deriveAttributesMessage() to avoid a potential ugly/harmless npe on windows
1 parent 3e11c92 commit 85c63a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/synopsys/integration/blackduck/imageinspector/linux/FileOperations.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private String deriveAttributesMessage(final File file) {
104104
attrs = Files.getFileAttributeView(file.toPath(), PosixFileAttributeView.class)
105105
.readAttributes();
106106
attrsMsg = String.format("File %s: owner: %s, group: %s, perms: %s", file.getAbsolutePath(), attrs.owner().getName(), attrs.group().getName(), PosixFilePermissions.toString(attrs.permissions()));
107-
} catch (final IOException e) {
107+
} catch (Exception e) {
108108
attrsMsg = String.format("File %s: Error getting attributes: %s", file.getAbsolutePath(), e.getMessage());
109109
}
110110
return attrsMsg;

0 commit comments

Comments
 (0)