You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "mercuryLuz (via GitHub)" <gi...@apache.org> on 2023/07/20 09:38:39 UTC

[GitHub] [commons-imaging] mercuryLuz commented on a diff in pull request #304: Make checkForSubImage null-safe

mercuryLuz commented on code in PR #304:
URL: https://github.com/apache/commons-imaging/pull/304#discussion_r1269210099


##########
src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java:
##########
@@ -75,7 +75,7 @@ private Rectangle checkForSubImage(
         // dimensions of the image that is being read.  This method
         // returns the sub-image specification, if any, and leaves
         // further tests to the calling module.
-        if (params.isSubImageSet()) {
+        if (params != null && params.isSubImageSet()) {

Review Comment:
   Thanks for the quick response!
   There are multiple calling methods and IMHO it makes the most sense within this method, so that any consumers can just use checkForSubImage(params) to find out whether there's any subImage data to be extracted no matter the given params.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org