Skip to content

Commit

Permalink
Merge pull request #79 from MegaMek/issue-68_advance_day_indexOOB
Browse files Browse the repository at this point in the history
Issue #68: IndexOutOfBoundsException when advancing day
  • Loading branch information
dericpage committed May 20, 2016
2 parents 72c1771 + ca441e7 commit af3fe48
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions MekHQ/docs/history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ v0.3.28-git
+ Bug [#925]: Issues with reload of MHQ and Settings
+ [AtB] When failure to deploy results in defeat, replace generated entities with stubs.
+ Issue #40: [ATB] 3.25 : Enemy reinforcements incorrectly set to deploy at the start of the game
+ Issue #68: IndexOutOfBoundsException when advancing day

v0.3.27 (2016-04-16 00:30 UTC)
+ Updated MegaMek.jar to 0.41.17
Expand Down
12 changes: 10 additions & 2 deletions MekHQ/src/mekhq/gui/CampaignGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -6683,7 +6683,11 @@ protected ArrayList<Person> getSelectedUnassignedPatients() {
return patients;
}
for (int idx : indices) {
patients.add((Person) unassignedPatientModel.getElementAt(idx));
Person p = assignedPatientModel.getElementAt(idx);
if (p == null) {
continue;
}
patients.add(p);
}
return patients;
}
Expand All @@ -6695,7 +6699,11 @@ protected ArrayList<Person> getSelectedAssignedPatients() {
return patients;
}
for (int idx : indices) {
patients.add((Person) assignedPatientModel.getElementAt(idx));
Person p = assignedPatientModel.getElementAt(idx);
if (p == null) {
continue;
}
patients.add(p);
}
return patients;
}
Expand Down
3 changes: 3 additions & 0 deletions MekHQ/src/mekhq/gui/model/PatientTableModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public void setData(ArrayList<Person> data) {

@Override
public Person getElementAt(int index) {
if (index < 0 || index >= patients.size()) {
return null;
}
return patients.get(index);
}

Expand Down

0 comments on commit af3fe48

Please sign in to comment.