Set the correct url when there is no network access

Prevent NPE in AddBookmark

When the network is down and a page is loaded,
the URL bar does not get updated with the URL.
If the page is reloaded after network is available,
it reloads the old URL (instead of what was specified).

Change-Id: I401d6e177f839f111b19d8eb0110a30b1b18059a
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java
index 814d93b..0ae1032 100644
--- a/src/com/android/browser/AddBookmarkPage.java
+++ b/src/com/android/browser/AddBookmarkPage.java
@@ -632,7 +632,6 @@
         String url = null;
 
         mFakeTitle = (TextView) findViewById(R.id.fake_title);
-
         if (mMap != null) {
             Bundle b = mMap.getBundle(EXTRA_EDIT_BOOKMARK);
             if (b != null) {
@@ -657,14 +656,13 @@
             url = mOriginalUrl = mMap.getString(BrowserContract.Bookmarks.URL);
             mTouchIconUrl = mMap.getString(TOUCH_ICON_URL);
             mCurrentFolder = mMap.getLong(BrowserContract.Bookmarks.PARENT, DEFAULT_FOLDER_ID);
+
+            if (title.length() > MAX_TITLE_LENGTH) {
+                title = title.substring(0, MAX_TITLE_LENGTH);
+            }
         }
 
         mTitle = (EditText) findViewById(R.id.title);
-
-        if (title.length() > MAX_TITLE_LENGTH) {
-            title = title.substring(0, MAX_TITLE_LENGTH);
-        }
-
         mTitle.setText(title);
         BrowserUtils.maxLengthFilter(AddBookmarkPage.this, mTitle, MAX_TITLE_LENGTH);