Why not just change the existing if statement to `if (cursor && cursor.message)`?