diff options
author | Leon Scroggins <scroggo@google.com> | 2010-03-08 14:34:14 -0500 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2010-03-08 14:37:04 -0500 |
commit | 3ee3fef2f83d47eff2f77fee359f561bc6ca53ac (patch) | |
tree | 523cda76c2403f97674a2cb642ea964ce035c44f /src/com/android/browser/BrowserDownloadPage.java | |
parent | b6a6544982df8c4dfa4a5871a3f6e0d9fe60dff3 (diff) | |
download | packages_apps_Browser-3ee3fef2f83d47eff2f77fee359f561bc6ca53ac.zip packages_apps_Browser-3ee3fef2f83d47eff2f77fee359f561bc6ca53ac.tar.gz packages_apps_Browser-3ee3fef2f83d47eff2f77fee359f561bc6ca53ac.tar.bz2 |
Check for null filename before creating a new file.
Fix for http://b/issue?id=2496729
Change-Id: I2250e42621df787e2c73da6343436d669177d255
Diffstat (limited to 'src/com/android/browser/BrowserDownloadPage.java')
-rw-r--r-- | src/com/android/browser/BrowserDownloadPage.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/com/android/browser/BrowserDownloadPage.java b/src/com/android/browser/BrowserDownloadPage.java index c8f848a..c56991e 100644 --- a/src/com/android/browser/BrowserDownloadPage.java +++ b/src/com/android/browser/BrowserDownloadPage.java @@ -133,13 +133,16 @@ public class BrowserDownloadPage extends ExpandableListActivity { int filenameColumnId = mDownloadCursor.getColumnIndexOrThrow( Downloads.Impl._DATA); String filename = mDownloadCursor.getString(filenameColumnId); - File file = new File(filename); - if (!file.exists()) { - long id = mDownloadCursor.getLong(mIdColumnId); - if (where == null) { - where = Downloads.Impl._ID + " = '" + id + "'"; - } else { - where += " OR " + Downloads.Impl._ID + " = '" + id + "'"; + if (filename != null) { + File file = new File(filename); + if (!file.exists()) { + long id = mDownloadCursor.getLong(mIdColumnId); + if (where == null) { + where = Downloads.Impl._ID + " = '" + id + "'"; + } else { + where += " OR " + Downloads.Impl._ID + " = '" + id + + "'"; + } } } } |