Skip to content

Commit

Permalink
Fix cast exception if non ims was aligned to ims files
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenHeu committed Mar 17, 2022
1 parent 17ed628 commit eb5f5fb
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ public FeatureShapeMobilogramChart(@NotNull ModularFeatureListRow row, AtomicDou

UnitFormat uf = MZmineCore.getConfiguration().getUnitFormat();

final MobilityType mt = ((IMSRawDataFile) row.getRawDataFiles().get(0)).getMobilityType();
final IMSRawDataFile imsFile = (IMSRawDataFile) row.getRawDataFiles().stream()
.filter(file -> file instanceof IMSRawDataFile).findAny().orElse(null);
if(imsFile == null) {
return;
}
final MobilityType mt = imsFile.getMobilityType();
SimpleXYChart<SummedMobilogramXYProvider> chart = new SimpleXYChart<>(mt.getAxisLabel(),
uf.format("Intensity", "a.u."));
chart.setRangeAxisNumberFormatOverride(MZmineCore.getConfiguration().getIntensityFormat());
Expand Down

0 comments on commit eb5f5fb

Please sign in to comment.