Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0a9ad37 authored by Etan Cohen's avatar Etan Cohen Committed by android-build-merger
Browse files

[NAN] TLV utilities iterator - throw correct exception

am: 3e5ac123

Change-Id: Ic6638a0d937f9eddba34cc1777655ab05e0e1bf6
parents e94a30b9 3e5ac123
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import java.nio.BufferOverflowException;
import java.nio.ByteOrder;
import java.util.Arrays;
import java.util.Iterator;
import java.util.NoSuchElementException;

/**
 * Utility class to construct and parse byte arrays using the TLV format -
@@ -464,6 +465,10 @@ public class TlvBufferUtils {

                @Override
                public TlvElement next() {
                    if (!hasNext()) {
                        throw new NoSuchElementException();
                    }

                    int type = 0;
                    if (mTypeSize == 1) {
                        type = mArray[mOffset];