Bug 776369 - Fix NullPointerException. r=bnicholson

This commit is contained in:
Michael Comella 2012-07-23 20:02:21 -04:00
Родитель c4c18a9031
Коммит f6aa463f03
1 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -136,12 +136,15 @@ class FontSizePreference extends DialogPreference {
if (mCurrentOrientation != newConfig.orientation) { if (mCurrentOrientation != newConfig.orientation) {
mCurrentOrientation = newConfig.orientation; mCurrentOrientation = newConfig.orientation;
// mPreviewFontView will be null if the dialog has not yet been shown.
if (mPreviewFontView != null) {
// Recalculate the mPreviewFontView dimensions since we have new screen dimensions. // Recalculate the mPreviewFontView dimensions since we have new screen dimensions.
setPreviewFontViewWidth(); setPreviewFontViewWidth();
mPreviewFontViewHeightSet = false; mPreviewFontViewHeightSet = false;
setFontSizeToMaximum(); // Expects onGlobalLayout() to be called. setFontSizeToMaximum(); // Expects onGlobalLayout() to be called.
} }
} }
}
/** /**
* Sets the preview font size to the maximum given size. * Sets the preview font size to the maximum given size.