| Index: android_webview/java/src/org/chromium/android_webview/AwPdfExporter.java
|
| diff --git a/android_webview/java/src/org/chromium/android_webview/AwPdfExporter.java b/android_webview/java/src/org/chromium/android_webview/AwPdfExporter.java
|
| index d02ba6604dae967fda6ef47b02df7ee9e05c5363..97f84fb1e81cbee6f20dc287c69d84e1e3580e19 100644
|
| --- a/android_webview/java/src/org/chromium/android_webview/AwPdfExporter.java
|
| +++ b/android_webview/java/src/org/chromium/android_webview/AwPdfExporter.java
|
| @@ -78,11 +78,16 @@ public class AwPdfExporter {
|
| @CalledByNative
|
| private void setNativeAwPdfExporter(long nativePdfExporter) {
|
| mNativeAwPdfExporter = nativePdfExporter;
|
| - // Handle the cornercase that Webview.Destroy is called before the native side
|
| - // has a chance to complete the pdf exporting.
|
| + // Handle the cornercase that the native side is destroyed (for example
|
| + // via Webview.Destroy) before it has a chance to complete the pdf exporting.
|
| if (nativePdfExporter == 0 && mResultCallback != null) {
|
| - mResultCallback.onReceiveValue(false);
|
| - mResultCallback = null;
|
| + try {
|
| + mResultCallback.onReceiveValue(false);
|
| + mResultCallback = null;
|
| + } catch (IllegalStateException ex) {
|
| + // Swallow the illegal state exception here. It is possible that app
|
| + // is going away and binder is already finalized. b/25462345
|
| + }
|
| }
|
| }
|
|
|
|
|