presence_dialoginfo(k): don't exeed array size in error case
- error handling could get to the size of array as index, resulting in
out of bounds operation
- patch by Marius-Ovidiu Bucur
(cherry picked from commit 48f3159cdcc9ef06114a6d8f853687dc1338a8f0)