Skip to content

Commit 2bd3c2f

Browse files
mghiwareAndroid (Google) Code Review
authored andcommitted
Merge "Fix null ptr exception in getReadingLevelScale()" into ics-mr0
2 parents dba6906 + 1698d45 commit 2bd3c2f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/java/android/webkit/ZoomManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ public final float getDefaultScale() {
314314
* Returns the zoom scale used for reading text on a double-tap.
315315
*/
316316
public final float getReadingLevelScale() {
317-
return mDisplayDensity * mWebView.getSettings().getDoubleTapZoom() / 100.0f;
317+
WebSettings settings = mWebView.getSettings();
318+
final float doubleTapZoomFactor = settings != null
319+
? settings.getDoubleTapZoom() / 100.f : 1.0f;
320+
return mDisplayDensity * doubleTapZoomFactor;
318321
}
319322

320323
public final float getInvDefaultScale() {

0 commit comments

Comments
 (0)