Skip to content

Commit

Permalink
[GR-4069] Fix getAllOptions fails with NPE.
Browse files Browse the repository at this point in the history
  • Loading branch information
ansalond committed Jul 14, 2017
2 parents a37b749 + f506583 commit 9ed9a01
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,6 @@ private static RuntimeException failDuplicateId(String duplicateId, String class
duplicateId, className1, className2));
}

private PolyglotInstrumentImpl getData(Instrument language) {
return (PolyglotInstrumentImpl) impl.getAPIAccess().getImpl(language);
}

final void checkState() {
if (closed) {
throw new IllegalStateException("Engine is already closed.");
Expand Down Expand Up @@ -481,8 +477,8 @@ OptionDescriptors getAllOptions() {
for (PolyglotLanguageImpl language : idToLanguage.values()) {
allDescriptors.add(language.getOptions());
}
for (Instrument instrument : idToPublicInstrument.values()) {
allDescriptors.add(getData(instrument).getOptions());
for (PolyglotInstrumentImpl instrument : idToInstrument.values()) {
allDescriptors.add(instrument.getOptions());
}
allOptions = OptionDescriptors.createUnion(allDescriptors.toArray(new OptionDescriptors[0]));
}
Expand Down

0 comments on commit 9ed9a01

Please sign in to comment.