diff --git a/debugger/assets/ui/code/code-tab.js b/debugger/assets/ui/code/code-tab.js index 1dcbd7735..5e746e5be 100644 --- a/debugger/assets/ui/code/code-tab.js +++ b/debugger/assets/ui/code/code-tab.js @@ -21,7 +21,11 @@ module.controller('CodeTabController', function( $scope.selectedModule = null; $scope.functionList = []; - $rootScope.$on('refresh', function() { + function refresh() { + if (!app.session || !app.session.dataSource) { + $scope.moduleList = []; + return; + } var dataSource = app.session.dataSource; dataSource.getModuleList().then(function(list) { @@ -38,7 +42,8 @@ module.controller('CodeTabController', function( }); console.log('refresh'); - }); + }; + $rootScope.$on('refresh', refresh); $scope.selectModule = function(module) { var moduleChange = module != $scope.selectedModule; @@ -55,4 +60,8 @@ module.controller('CodeTabController', function( log.error('Unable to fetch function list'); }); }; + + if (app.session.dataSource) { + refresh(); + } }); diff --git a/debugger/assets/ui/code/function-view.html b/debugger/assets/ui/code/function-view.html index 884fcf884..39bd3d1a0 100644 --- a/debugger/assets/ui/code/function-view.html +++ b/debugger/assets/ui/code/function-view.html @@ -7,9 +7,12 @@