From bf5f0daca547f33acc228596168bb87ac25639fe Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Fri, 12 May 2023 10:03:30 +0100 Subject: [PATCH] NI Playback bug Fix bug in NI playback which threw an exception if no devices were present and configured in NI-MAX --- src/nidaqdev/NIFilePlayback.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nidaqdev/NIFilePlayback.java b/src/nidaqdev/NIFilePlayback.java index f87a35ef..3b8b42ed 100644 --- a/src/nidaqdev/NIFilePlayback.java +++ b/src/nidaqdev/NIFilePlayback.java @@ -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];