This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 011b325c92ebbe2dca57d276f2dfebb159071cae
Author: Marcus Christie <machr...@iu.edu>
AuthorDate: Thu Jul 12 11:24:57 2018 -0400

    AIRAVATA-2835 Bug fix: don't try to convert null/undefined field value
---
 .../apps/api/static/django_airavata_api/js/models/BaseModel.js        | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/django_airavata/apps/api/static/django_airavata_api/js/models/BaseModel.js 
b/django_airavata/apps/api/static/django_airavata_api/js/models/BaseModel.js
index 5bb0c63..56cf29f 100644
--- a/django_airavata/apps/api/static/django_airavata_api/js/models/BaseModel.js
+++ b/django_airavata/apps/api/static/django_airavata_api/js/models/BaseModel.js
@@ -33,7 +33,9 @@ export default class BaseModel {
     }
 
     convertField(fieldType, fieldValue, fieldDefault) {
-        if (fieldType === 'string' || fieldType === 'boolean' || fieldType === 
'number') {
+        if (fieldValue === null || typeof fieldValue === 'undefined') {
+            return fieldDefault;
+        } else if (fieldType === 'string' || fieldType === 'boolean' || 
fieldType === 'number') {
             return this.convertSimpleField(fieldValue, fieldDefault);
         } else if (fieldType === 'date') {
             return this.convertDateField(fieldValue, fieldDefault);

Reply via email to