mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-20 18:08:19 +00:00
Bug 833777 - Ensure that a tab is selected after an OOM restore. r=mfinkle
This commit is contained in:
parent
b470ffac2e
commit
134697173e
@ -53,7 +53,7 @@ public abstract class SessionParser {
|
||||
public void parse(String sessionString) {
|
||||
final JSONArray tabs;
|
||||
final JSONObject window;
|
||||
final int selected;
|
||||
int selected = -1;
|
||||
try {
|
||||
window = new JSONObject(sessionString).getJSONArray("windows").getJSONObject(0);
|
||||
tabs = window.getJSONArray("tabs");
|
||||
@ -63,7 +63,12 @@ public abstract class SessionParser {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < tabs.length(); i++) {
|
||||
int numTabs = tabs.length();
|
||||
if (selected < 1 || selected > numTabs) {
|
||||
selected = 1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < numTabs; i++) {
|
||||
try {
|
||||
JSONObject tab = tabs.getJSONObject(i);
|
||||
int index = tab.getInt("index");
|
||||
|
Loading…
x
Reference in New Issue
Block a user