add check for invalid ros message pointer