Skip to content
This repository was archived by the owner on Oct 18, 2018. It is now read-only.

Commit 5dbfd38

Browse files
committed
Server throws error when no file is selected
1 parent 932b37d commit 5dbfd38

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/webapp/app.controller.pageCanvas.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
function main($rootScope, $scope, AnnotationListFactory, DocumentInfoFactory) {
55

66
$rootScope.$watch('selectedFile', function () {
7+
if (typeof($rootScope.selectedFile) !== 'string' || !$rootScope.selectedFile.length) {
8+
return;
9+
}
10+
711
$rootScope.docInfo = DocumentInfoFactory.get({
812
filename: $rootScope.selectedFile
913
});
1014
$rootScope.annotationsList = AnnotationListFactory.query({
1115
filename: $rootScope.selectedFile
1216
});
17+
});
18+
19+
$rootScope.$watch('selectedFile', function () {
1320
$rootScope.selectedDrawingTool = 'select';
1421
$rootScope.selectedAnnotationGuid = null;
1522
});

0 commit comments

Comments
 (0)