[counters] Fix -1 array access in case counter is of type string and value is null