protobuf2json: fix null pointer dereference reported by cppcheck