Would you mind adding ' != NULL` here and below to make it clearer?