Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #68: IndexOutOfBoundsException when advancing day #79

Merged
merged 1 commit into from
May 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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