From 3ff9b3841676bed46f6b23aa65c2366ce494bb15 Mon Sep 17 00:00:00 2001 From: HLAD Nicolas Date: Fri, 6 Sep 2024 17:42:35 +0200 Subject: [PATCH] fix empty user --- src/JiraPharoAPI/JiraPharoImporter.class.st | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/JiraPharoAPI/JiraPharoImporter.class.st b/src/JiraPharoAPI/JiraPharoImporter.class.st index 4d30ca9..e2915eb 100644 --- a/src/JiraPharoAPI/JiraPharoImporter.class.st +++ b/src/JiraPharoAPI/JiraPharoImporter.class.st @@ -102,9 +102,10 @@ JiraPharoImporter >> extractUserFromAccountID: accountId [ { #category : #'api - import' } JiraPharoImporter >> importAllCurrentAndPastIssuesOf: anEmail [ - | user modelUser issues | - user := self api findUserUsingQuery: anEmail. - modelUser := self importUserFromAccountID: user first accountId. + | possibleUsers modelUser issues | + possibleUsers := self api findUserUsingQuery: anEmail. + possibleUsers ifEmpty: [ ^ { } ]. + modelUser := self importUserFromAccountID: possibleUsers first accountId. issues := self importAllIssuesFromQuery: 'assignee was ' , modelUser accountId. issues do: [ :iss | iss addHistoricallyAssigned: modelUser ].