diff --git a/gradle.properties b/gradle.properties index 67eafea..5c52ae5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -profileServiceVersion=5.2-SNAPSHOT +profileServiceVersion=5.2.2-SNAPSHOT grailsVersion=5.2.4 gorm.version=7.3.2 groovyVersion=3.0.11 diff --git a/grails-app/services/au/org/ala/profile/ProfileService.groovy b/grails-app/services/au/org/ala/profile/ProfileService.groovy index 74f9644..7030667 100644 --- a/grails-app/services/au/org/ala/profile/ProfileService.groovy +++ b/grails-app/services/au/org/ala/profile/ProfileService.groovy @@ -610,7 +610,12 @@ class ProfileService extends BaseDataAccessService { save profile } else { profile.draft = profile.draft ?: CloneAndDraftUtil.createDraft(profile) - profile.draft.createdBy = userService.getUserForUserId(userService.getUserId()).displayName + + if (userService.getUserId()) { + profile.draft.createdBy = userService.getUserForUserId(userService.getUserId()).displayName + } else { + log.debug("No user ID when switching profile to draft") + } save profile }