NI Playback bug

Fix bug in NI playback which threw an exception if no devices were
present and configured in NI-MAX
This commit is contained in:
Douglas Gillespie 2023-05-12 10:03:30 +01:00
parent f5ff9da8dd
commit bf5f0daca5

View File

@ -127,7 +127,8 @@ public class NIFilePlayback implements FilePlaybackDevice, PamSettings {
@Override
public boolean preparePlayback(PlaybackParameters playbackParameters) {
if (niDeviceLUT == null || niDeviceLUT.length <= playbackParameters.deviceNumber) {
if (niDeviceLUT == null || niDeviceLUT.length <= playbackParameters.deviceNumber
|| playbackParameters.deviceNumber < 0) {
return false;
}
int bn = niDeviceLUT[playbackParameters.deviceNumber];