You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/03/21 18:03:26 UTC
[commons-imaging] 03/04: Fix null check
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git
commit 5b2f5c7241ab8bae2470619a6b971359d3ea5920
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Mar 21 14:02:44 2023 -0400
Fix null check
Normalize NPE message
---
.../java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java
index 016ed3d2..b83043e9 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java
@@ -29,8 +29,8 @@ public class IptcBlock {
private final byte[] blockData;
public IptcBlock(final int blockType, final byte[] blockNameBytes, final byte[] blockData) {
- Objects.requireNonNull(blockNameBytes, "Block name bytes must not be null.");
- Objects.requireNonNull(blockNameBytes, "Block data bytes must not be null.");
+ Objects.requireNonNull(blockNameBytes, "blockNameBytes");
+ Objects.requireNonNull(blockData, "blockData");
this.blockData = blockData;
this.blockNameBytes = blockNameBytes;
this.blockType = blockType;
@@ -48,7 +48,6 @@ public class IptcBlock {
return blockData.clone();
}
-
public boolean isIPTCBlock() {
return blockType == IptcConstants.IMAGE_RESOURCE_BLOCK_IPTC_DATA;
}