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

This commit is contained in:
Nathan Gray 2014-09-22 16:16:11 +00:00
parent 3ab3c93f6d
commit c27e4f2098

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