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:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user