improve null-safety
Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/52947266 Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/52947266 Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/52947266 Branch: refs/heads/master Commit: 52947266af5797cee1a9277ffea125cbf5363925 Parents: 6b75de4 Author: Stefan Bodewig <[email protected]> Authored: Mon Dec 19 18:40:11 2016 +0100 Committer: Stefan Bodewig <[email protected]> Committed: Mon Dec 19 18:42:11 2016 +0100 ---------------------------------------------------------------------- .../org/apache/commons/compress/archivers/tar/TarArchiveEntry.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-compress/blob/52947266/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java index 1360787..e7116ec 100644 --- a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java +++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java @@ -376,7 +376,7 @@ public class TarArchiveEntry implements TarConstants, ArchiveEntry { * @return True if the entries are equal. */ public boolean equals(final TarArchiveEntry it) { - return getName().equals(it.getName()); + return it != null && getName().equals(it.getName()); } /**
