]> source.dussan.org Git - sonarqube.git/commitdiff
fix SONAR-6041 fix issue with empty recent history
authorStas Vilchik <vilchiks@gmail.com>
Wed, 14 Jan 2015 14:36:56 +0000 (15:36 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 14 Jan 2015 14:36:56 +0000 (15:36 +0100)
server/sonar-web/src/main/js/nav/search-view.js

index fa092a71b8ddb69a25469ceb1ca97208dfdabba0..b4a5d5a7a4ca487b0b360c65eb31f5f6d0bd4ca8 100644 (file)
@@ -99,7 +99,7 @@ define([
 
     resetResultsToDefault: function () {
       var recentHistory = JSON.parse(localStorage.getItem('sonar_recent_history')),
-          history = recentHistory.map(function (historyItem) {
+          history = (recentHistory || []).map(function (historyItem) {
             return {
               url: baseUrl + '/dashboard/index?id=' + encodeURIComponent(historyItem.key) + dashboardParameters(true),
               name: historyItem.name,