Check project has ref before trying to erase