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
This commit is contained in:
Svet Ganov
2014-09-14 20:29:27 -07:00
parent 2047df6f5f
commit e771caf332

View File

@@ -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();