Skip to content

Commit 0e47b07

Browse files
committed
[lib] Fixed element copying issue in byte array int list
1 parent 5b2b32b commit 0e47b07

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tehreer-android/src/main/java/com/mta/tehreer/internal/collections/JByteArrayIntList.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ public int get(int index) {
4646

4747
@Override
4848
public void copyTo(int[] array, int atIndex) {
49+
if (array == null) {
50+
throw new NullPointerException();
51+
}
52+
4953
for (int i = 0; i < size; i++) {
50-
array[atIndex + i] = this.array[i];
54+
array[atIndex + i] = this.array[i + offset];
5155
}
5256
}
5357

0 commit comments

Comments
 (0)