commit | 38fed63630f2f376f50c5096645cc9f0d4cc74c1 | [log] [tgz] |
---|---|---|
author | David Pursehouse <david.pursehouse@sonymobile.com> | Wed May 20 12:20:23 2015 +0900 |
committer | David Pursehouse <david.pursehouse@sonymobile.com> | Thu May 21 00:18:28 2015 +0000 |
tree | e627e896bdfb5870f4c17aed128ac2e4f4f0fcf7 | |
parent | d581e2e636a32b6925fedc06023116e1beef8066 [diff] |
Prevent potential null-pointer access Path.getFilename can return null. Protect against dereferencing a null value. Change-Id: Ibcda5ada4b8936b7e7520b840368ed0976ea1bb0
diff --git a/src/main/java/com/googlesource/gerrit/plugins/rabbitmq/config/PluginProperties.java b/src/main/java/com/googlesource/gerrit/plugins/rabbitmq/config/PluginProperties.java index 5976245..36ba106 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/rabbitmq/config/PluginProperties.java +++ b/src/main/java/com/googlesource/gerrit/plugins/rabbitmq/config/PluginProperties.java
@@ -115,7 +115,10 @@ @Override public String getName() { if (propertiesFile != null) { - return FilenameUtils.removeExtension(propertiesFile.getFileName().toString()); + Path path = propertiesFile.getFileName(); + if (path != null) { + return FilenameUtils.removeExtension(path.toString()); + } } return null; }