Bug 793136: Crash on content type being null. [r=mfinkle]
authorSriram Ramasubramanian <sriram@mozilla.com>
Mon, 24 Sep 2012 16:42:53 -0700
changeset 107944 8ee445d27224368ad8af65ce516c54e20131adba
parent 107943 d12c34bb82fa3100d0986ef5dec17e865d21e81d
child 107945 74a9ba7336cfae0813d62955f3de4344aa20a635
push id15293
push usersramasubramanian@mozilla.com
push dateMon, 24 Sep 2012 23:42:55 +0000
treeherdermozilla-inbound@8ee445d27224 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs793136
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 793136: Crash on content type being null. [r=mfinkle]
mobile/android/base/Tab.java
mobile/android/chrome/content/browser.js
--- a/mobile/android/base/Tab.java
+++ b/mobile/android/base/Tab.java
@@ -258,17 +258,17 @@ public final class Tab {
         mDocumentURI = documentURI;
     }
 
     public String getDocumentURI() {
         return mDocumentURI;
     }
 
     public void setContentType(String contentType) {
-        mContentType = contentType;
+        mContentType = (contentType == null) ? "" : contentType;
     }
 
     public String getContentType() {
         return mContentType;
     }
 
     public synchronized void updateTitle(String title) {
         // Keep the title unchanged while entering reader mode
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3226,17 +3226,17 @@ Tab.prototype = {
     }
 
     let message = {
       gecko: {
         type: "Content:LocationChange",
         tabID: this.id,
         uri: fixedURI.spec,
         documentURI: documentURI,
-        contentType: contentType,
+        contentType: (contentType ? contentType : ""),
         sameDocument: sameDocument
       }
     };
 
     sendMessageToJava(message);
 
     if (!sameDocument) {
       // XXX This code assumes that this is the earliest hook we have at which