You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2021/11/17 20:09:14 UTC

[GitHub] [sling-org-apache-sling-servlets-resolver] enapps-enorman commented on a change in pull request #22: Fix null pointer exception

enapps-enorman commented on a change in pull request #22:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/22#discussion_r751596983



##########
File path: src/main/java/org/apache/sling/servlets/resolver/internal/HandleErrorSlingHttpServletResponse.java
##########
@@ -48,7 +48,7 @@ public PrintWriter getWriter() throws IOException {
      * @return true of open, false otherwise
      */
     public boolean isOpen() {
-        return this.writer.isOpen();
+        return getWriter().isOpen();

Review comment:
       This should work.  However, perhaps it would be a bit more efficient to just check if this.writer is null and return false instead of calling getWriter() since you would have one less object to get garbage collected later. 




-- 
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: dev-unsubscribe@sling.apache.org

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