Skip to content

Commit 64bce59

Browse files
committed
Allow clients to upload group avatar at creation time
1 parent e486655 commit 64bce59

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/main/java/org/signal/storageservice/controllers/GroupsController.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,10 @@ public CompletableFuture<Response> getAvatarUploadForm(@Auth GroupUser user) {
345345

346346
return groupsManager.getGroup(user.getGroupId()).thenApply(group -> {
347347

348-
if (group.isEmpty()) {
349-
return Response.status(Response.Status.NOT_FOUND).build();
350-
}
351-
352-
if (!GroupAuth.isModifyAttributesAllowed(user, group.get())) {
353-
return Response.status(Response.Status.FORBIDDEN).build();
348+
if (group.isPresent()) {
349+
if (!GroupAuth.isModifyAttributesAllowed(user, group.get())) {
350+
return Response.status(Response.Status.FORBIDDEN).build();
351+
}
354352
}
355353

356354
final byte[] object = new byte[16];

0 commit comments

Comments
 (0)