From 5e6687c751fd67f98cd37958133d470cea2db17a Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 23 Sep 2014 08:59:52 +0000 Subject: [PATCH] Fix diff widget to better handle empty values (cleared fields) --- etemplate/js/et2_widget_diff.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_diff.js b/etemplate/js/et2_widget_diff.js index 98029c5fe7..4a73d77b50 100644 --- a/etemplate/js/et2_widget_diff.js +++ b/etemplate/js/et2_widget_diff.js @@ -49,7 +49,7 @@ var et2_diff = et2_valueWidget.extend([et2_IDetachedDOM], set_value: function(value) { jQuery(this.div).empty(); - if(value['old'] && value['new']) { + if(typeof value['old'] == 'string' && typeof value['new'] == 'string') { // Build diff var old_text = difflib.stringAsLines(value['old'].toString()); var new_text = difflib.stringAsLines(value['new'].toString());