Bug 704117 - Fix null title in HistoryEntry [r=sriram]

Code in GeckoApp assumes that the title and url fields
in HistoryEntry will always be non-null, so fix possible
NPEs by not putting null values in them.
This commit is contained in:
Kartikaya Gupta
2011-11-21 14:08:34 -05:00
parent 19743246cc
commit b6e90bee7e

View File

@@ -74,8 +74,8 @@ public class Tab {
private long mFaviconLoadId; private long mFaviconLoadId;
static class HistoryEntry { static class HistoryEntry {
public final String mUri; public final String mUri; // must never be null
public String mTitle; public String mTitle; // must never be null
public HistoryEntry(String uri, String title) { public HistoryEntry(String uri, String title) {
mUri = uri; mUri = uri;
@@ -293,7 +293,7 @@ public class Tab {
while (mHistory.size() > mHistoryIndex) { while (mHistory.size() > mHistoryIndex) {
mHistory.remove(mHistoryIndex); mHistory.remove(mHistoryIndex);
} }
HistoryEntry he = new HistoryEntry(uri, null); HistoryEntry he = new HistoryEntry(uri, "");
mHistory.add(he); mHistory.add(he);
GeckoAppShell.getHandler().post(new Runnable() { GeckoAppShell.getHandler().post(new Runnable() {
public void run() { public void run() {