From e771caf332bb3f2b668aaf249b30f37f13755553 Mon Sep 17 00:00:00 2001 From: Svet Ganov Date: Sun, 14 Sep 2014 20:29:27 -0700 Subject: Fix a crash in pring spooler. If the printer capabilities are reported with a delay which is pretty common we were trying to evaluate the preview page dimensions without having a media size resulting in a NPE. bug:17501953 Change-Id: I6765137f61b8fd060e9eabff07e632875d934963 --- .../PrintSpooler/src/com/android/printspooler/ui/PageAdapter.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'packages') diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/PageAdapter.java b/packages/PrintSpooler/src/com/android/printspooler/ui/PageAdapter.java index faaf0ae..13eb73f 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/ui/PageAdapter.java +++ b/packages/PrintSpooler/src/com/android/printspooler/ui/PageAdapter.java @@ -384,6 +384,10 @@ public final class PageAdapter extends Adapter implements } private void updatePreviewAreaPageSizeAndEmptyState() { + if (mMediaSize == null) { + return; + } + final int availableWidth = mPreviewArea.getWidth(); final int availableHeight = mPreviewArea.getHeight(); -- cgit v1.1