From 4f8351323b84a7b8c3275e6df8a99a4738fabf45 Mon Sep 17 00:00:00 2001
From: Selim Gurun <sgurun@google.com>
Date: Fri, 27 Apr 2012 10:08:17 -0700
Subject: Properly clean an exception to prevent a crash

Bug: 6404408
Change-Id: Id9a6e1ff303076da24f0221d3bc905ba0710f07e
---
 android/net/android_network_library_impl.cc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/android/net/android_network_library_impl.cc b/android/net/android_network_library_impl.cc
index 1989621..433ca61 100644
--- a/android/net/android_network_library_impl.cc
+++ b/android/net/android_network_library_impl.cc
@@ -105,6 +105,11 @@ AndroidNetworkLibraryImpl::VerifyResult
       }
       env->DeleteLocalRef(error);
     }
+  } else {
+    // an uncaught exception has happened in java code, clear it and return
+    // a proper error
+    env->ExceptionClear();
+    result = VERIFY_INVOCATION_ERROR;
   }
   // TODO(joth): This balances the GetJNIEnv call; we need to detach as
   // currently this method is called in chrome from a worker pool thread that
-- 
cgit v1.1