It's simpler, easier, and (imo) looks better if you just check if (!cur).