Skip to content

Commit 646fe5c

Browse files
EcljpseB0Tjukzi
authored andcommitted
MarkerComparator.saveState: fix ArrayIndexOutOfBoundsException
as logged during UiTestSuite
1 parent aec1a42 commit 646fe5c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/MarkerComparator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ void restore(IMemento memento) {
187187
* Save the current sort field in the memento.
188188
*/
189189
void saveState(IMemento memento) {
190-
memento.putString(PRIMARY_SORT_FIELD_TAG, MarkerSupportInternalUtilities.getId(fields[0]));
190+
if (fields != null && fields.length > 0) {
191+
memento.putString(PRIMARY_SORT_FIELD_TAG, MarkerSupportInternalUtilities.getId(fields[0]));
192+
}
191193
Iterator<MarkerField> descendingIterator = descendingFields.iterator();
192194
while (descendingIterator.hasNext()) {
193195
memento.createChild(DESCENDING_FIELDS, (MarkerSupportInternalUtilities.getId(descendingIterator.next())));

0 commit comments

Comments
 (0)