|
@@ -217,6 +217,10 @@ export default class AutoHeightWebView extends PureComponent {
|
217
|
217
|
if (!e.nativeEvent) {
|
218
|
218
|
return;
|
219
|
219
|
}
|
|
220
|
+
|
|
221
|
+ // Sometimes the message is invalid JSON, so we ignore that case
|
|
222
|
+ try { JSON.parse(isBelowKitKat ? e.nativeEvent.message : e.nativeEvent.data) } catch(e) { return }
|
|
223
|
+
|
220
|
224
|
const { height, width } = JSON.parse(isBelowKitKat ? e.nativeEvent.message : e.nativeEvent.data);
|
221
|
225
|
const { height: oldHeight, width: oldWidth } = this.state;
|
222
|
226
|
if (isSizeChanged(height, oldHeight, width, oldWidth)) {
|