Return NPE instead of ISE if page is closed.

To comply with the legacy behavior.

Change-Id: I2b3c4d6d1f41022e72e5c22fe4402864d9e54986
This commit is contained in:
Philip P. Moltmann
2016-06-10 14:15:39 -07:00
parent 8a420dc7d5
commit f3f7cccccf

View File

@@ -374,7 +374,9 @@ public final class PdfRenderer implements AutoCloseable {
*/
public void render(@NonNull Bitmap destination, @Nullable Rect destClip,
@Nullable Matrix transform, @RenderMode int renderMode) {
throwIfClosed();
if (mNativePage == 0) {
throw new NullPointerException();
}
destination = Preconditions.checkNotNull(destination, "bitmap null");