[api] fix the ActiveRecord::ReadOnlyRecord exception when the @product is null when update the variant