From ad5e07f40b4d7b331029da00b6a790ca8b29df7b Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 3 Dec 2014 10:33:05 +0100 Subject: [PATCH] SONAR-5718 Fix loading more source code --- server/sonar-web/src/main/js/source-viewer/viewer.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/server/sonar-web/src/main/js/source-viewer/viewer.js b/server/sonar-web/src/main/js/source-viewer/viewer.js index d97199c3c33..7891f113545 100644 --- a/server/sonar-web/src/main/js/source-viewer/viewer.js +++ b/server/sonar-web/src/main/js/source-viewer/viewer.js @@ -396,8 +396,10 @@ define([ source: source, hasSourceBefore: data.sources.length === that.LINES_AROUND }); - that.model.addDuplications(that.model.get('duplications')); - that.model.addMeta(that.model.get('duplicationsParsed')); + if (that.model.has('duplications')) { + that.model.addDuplications(that.model.get('duplications')); + that.model.addMeta(that.model.get('duplicationsParsed')); + } that.render(); that.scrollToLine(firstLine); if (that.model.get('hasSourceBefore') || that.model.get('hasSourceAfter')) { @@ -423,8 +425,10 @@ define([ source: source, hasSourceAfter: data.sources.length === that.LINES_AROUND }); - that.model.addDuplications(that.model.get('duplications')); - that.model.addMeta(that.model.get('duplicationsParsed')); + if (that.model.has('duplications')) { + that.model.addDuplications(that.model.get('duplications')); + that.model.addMeta(that.model.get('duplicationsParsed')); + } that.render(); if (that.model.get('hasSourceBefore') || that.model.get('hasSourceAfter')) { that.bindScrollEvents(); -- 2.39.5