Skip to content

Commit 111d1e1

Browse files
committed
Only attempt avatar upload when source avatar exists
1 parent 91cc45d commit 111d1e1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

services/auth/source/ldap/source_sync.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,9 @@ func (source *Source) Sync(ctx context.Context, updateExisting bool) error {
178178
}
179179
}
180180

181-
if usr.IsUploadAvatarChanged(su.Avatar) {
182-
if err == nil && source.AttributeAvatar != "" {
181+
if err == nil && source.AttributeAvatar != "" {
182+
if len(su.Avatar) > 0 && usr.IsUploadAvatarChanged(su.Avatar) {
183+
log.Trace("SyncExternalUsers[%s]: Uploading new avatar for %s", source.authSource.Name, usr.Name)
183184
_ = user_service.UploadAvatar(ctx, usr, su.Avatar)
184185
}
185186
}

0 commit comments

Comments
 (0)