Task Router: check for None
@@ -82,7 +82,7 @@ class TaskRouter:
# Build time average is high
length_avg = queryset.filter(pk__in=last_builds).aggregate(Avg('length')).get('length__avg')
- if length_avg > self.TIME_AVERAGE:
+ if length_avg and length_avg > self.TIME_AVERAGE:
log.info(
'Routing task because project has high time average. queue=%s',
self.BUILD_LARGE_QUEUE,
