if contrib and contrib.inapp_product is not None

using getattr is bad