From 874c3b987da90a27bdfd81e64c3b5f68e1ca98d9 Mon Sep 17 00:00:00 2001 From: annieyu Date: Tue, 16 Apr 2013 11:46:41 +0800 Subject: Fix the problem that a crash occured when user turn off data connect and download something in browser When user turn off data connect in browser throught statusbar shortcut, the request object is null. It will be crush browser. Change-Id: Icdbd40618d221cc205e497e860a9508f4cd18741 --- src/com/android/browser/FetchUrlMimeType.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/android/browser/FetchUrlMimeType.java b/src/com/android/browser/FetchUrlMimeType.java index 33b5808..6556b38 100644 --- a/src/com/android/browser/FetchUrlMimeType.java +++ b/src/com/android/browser/FetchUrlMimeType.java @@ -107,9 +107,13 @@ class FetchUrlMimeType extends Thread { } } } catch (IllegalArgumentException ex) { - request.abort(); + if (request != null) { + request.abort(); + } } catch (IOException ex) { - request.abort(); + if (request != null) { + request.abort(); + } } finally { client.close(); } -- cgit v1.1