I saw this error come through, unfortunately I don’t have the value it processed to re-produce the error but wondered if this was the correct way to convert a hex value to an integer?
2019-03-06T14:29:40.288 +00:00 [Device] ERROR: arith op + on between ‘integer’ and ‘null’
2019-03-06T14:29:40.288 +00:00 [Device] ERROR: in hextoint device_code:851
function hextoint(m, index, len) { // convert ascii hex to int
local n = 0;
for (local i = 0; i < len; i++) {
n = n << 4;
n+="0123456789ABCDEF".find(m.slice(index+i,index+i+1));
}
return n;
}
Not my code for clarity I wonder if maybe the hex wasn’t of the length expected so the find produced the null?