From 409b3917662278e213bf08ab30f67d816b98e71d Mon Sep 17 00:00:00 2001 From: Daishan Peng Date: Wed, 17 Jan 2018 16:49:33 -0700 Subject: [PATCH] don't return nonnullable error if default is set --- parse/builder/builder.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parse/builder/builder.go b/parse/builder/builder.go index bb76d0d5..7a6731c2 100644 --- a/parse/builder/builder.go +++ b/parse/builder/builder.go @@ -162,7 +162,9 @@ func checkFieldCriteria(fieldName string, field types.Field, value interface{}) } if (value == nil || value == "") && !field.Nullable { - return httperror.NewFieldAPIError(httperror.NotNullable, fieldName, "") + if field.Default == nil { + return httperror.NewFieldAPIError(httperror.NotNullable, fieldName, "") + } } if isNum {