Skip to content

Commit 992069d

Browse files
marknolanCopilot
andauthored
Update ShimmerDriver/src/main/java/com/shimmerresearch/bluetooth/ShimmerBluetooth.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent d5b2c3d commit 992069d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ShimmerDriver/src/main/java/com/shimmerresearch/bluetooth/ShimmerBluetooth.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ protected void discardBufferBytesToNextPacket(){
13101310
mByteArrayOutputStream.write(bTemp, offset, bTemp.length-offset); // discard first 'offset' bytes
13111311
if(mEnablePCTimeStamps) {
13121312
// Remove first `offset` elements from the original list (destructive, modifies same list)
1313-
mListofPCTimeStamps.subList(0, offset).clear();
1313+
mListofPCTimeStamps.subList(0, Math.min(offset, mListofPCTimeStamps.size())).clear();
13141314
}
13151315
consolePrintLn("Throw Bytes " + UtilShimmer.bytesToHexStringWithSpacesFormatted(Arrays.copyOfRange(bTemp, 0, offset)));
13161316
}

0 commit comments

Comments
 (0)