VIVO-503 add a null pointer check