public static void closeSafely(@Nullable EncodedImage encodedImage) {
    if (encodedImage != null) {
      encodedImage.close();
    }
  }
Closes the encoded image handling null.

@param encodedImage the encoded image to close.
imagepipeline-base/src/main/java/com/facebook/imagepipeline/image/EncodedImage.java