annotation_dashboard/commit

FIXED: do not crash if task representative image cannot be found

authorJacco van Ossenbruggen
Fri Sep 19 15:41:04 2014 +0200
committerJacco van Ossenbruggen
Fri Sep 19 15:41:04 2014 +0200
commit97af50a3497da032be9a07acd7f91553b2497b44
tree0963da7ba1e8dc482fc918ac85194b8cb6546eaa
parent71f949c403fde284a90f5cfa4f590d6e645b6553
Diff style: patch stat
diff --git a/lib/dashboard_util.pl b/lib/dashboard_util.pl
index deb3c4b..b883740 100644
--- a/lib/dashboard_util.pl
+++ b/lib/dashboard_util.pl
@@ -143,7 +143,9 @@ count_annotations(Target, Count-Target) :-
 representative(Candidates, Representative) :-
 	maplist(count_annotations, Candidates, Counts),
 	sort(Counts, Sorted),
-	reverse(Sorted, [_Count-Representative|_]).
+	reverse(Sorted, [_Count-Representative|_]),!.
+
+representative(_, no_representative_found).
 
 property_key_label(500, targets_untouched, 'works without tags').
 property_key_label(200, targets_total,     'works targeted').