Fix diff widget to better handle empty values (cleared fields)

This commit is contained in:
Hadi Nategh 2014-09-23 08:59:52 +00:00
parent 278a0ccdd6
commit 5e6687c751

View File

@ -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());