`if (profile) {` should be sufficient.