diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt
index 9b4d7d072..160d93df9 100644
--- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt
+++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt
@@ -45,24 +45,28 @@ POSSIBILITY OF SUCH DAMAGE.
function update_showdiff() {
ajaxCall(url="/api/haproxy/export/diff/", sendData={}, callback=function(data,status) {
diff = '';
- var lines = data['response'].split("\n");
- $.each(lines, function(n, line) {
- switch(line.substring(0,1)) {
- case '+':
- color = '#3bbb33';
- break;
- case '-':
- color = '#c13928';
- break;
- case '@':
- color = '#3bb9c3';
- break;
- default:
- color = '#000000';
- }
- diff += '' + line + '
';
+ if (data['response'] && data['response'].trim()) {
+ var lines = data['response'].split("\n");
+ $.each(lines, function(n, line) {
+ switch(line.substring(0,1)) {
+ case '+':
+ color = '#3bbb33';
+ break;
+ case '-':
+ color = '#c13928';
+ break;
+ case '@':
+ color = '#3bb9c3';
+ break;
+ default:
+ color = '#000000';
+ }
+ diff += '' + line + '
';
- });
+ });
+ } else {
+ diff = "
{{ lang._('New and old config files are identical.') }}
";
+ }
$("#showdiff").append(diff);
});
}