From e755eb2f789c0d1b0266cd1b59e993127adabb47 Mon Sep 17 00:00:00 2001 From: pnispel Date: Tue, 17 Jun 2014 10:34:08 -0700 Subject: [PATCH] made sure not to call store_performance_artifact unless there is performance data --- treeherder/webapp/api/artifact.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/treeherder/webapp/api/artifact.py b/treeherder/webapp/api/artifact.py index f874e3dd4..c951cb629 100644 --- a/treeherder/webapp/api/artifact.py +++ b/treeherder/webapp/api/artifact.py @@ -65,8 +65,11 @@ class ArtifactViewSet(viewsets.ViewSet): datum['name'], )) - jm.store_job_artifact(artifact_data) - jm.store_performance_artifact( - job_id_list, performance_artifact_data) + if artifact_data: + jm.store_job_artifact(artifact_data) + + if job_id_list and performance_artifact_data: + jm.store_performance_artifact( + job_id_list, performance_artifact_data) return Response({'message': 'Artifacts stored successfully'})