diff options
author | Svet Ganov <svetoslavganov@google.com> | 2014-09-14 20:29:27 -0700 |
---|---|---|
committer | Svet Ganov <svetoslavganov@google.com> | 2014-09-14 20:29:30 -0700 |
commit | e771caf332bb3f2b668aaf249b30f37f13755553 (patch) | |
tree | 8cb00bc3e800c6c9391799c7c951678352b16a51 /packages | |
parent | 2047df6f5f6af14cdb93f220c0329f1bff7a43ff (diff) | |
download | frameworks_base-e771caf332bb3f2b668aaf249b30f37f13755553.zip frameworks_base-e771caf332bb3f2b668aaf249b30f37f13755553.tar.gz frameworks_base-e771caf332bb3f2b668aaf249b30f37f13755553.tar.bz2 |
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
Diffstat (limited to 'packages')
-rw-r--r-- | packages/PrintSpooler/src/com/android/printspooler/ui/PageAdapter.java | 4 |
1 files changed, 4 insertions, 0 deletions
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(); |