Don't crash on packs missing metadata.

This commit is contained in:
Greyson Parrelli 2019-12-29 15:17:59 -05:00 committed by Alan Evans
parent b598431237
commit 3fbf21a34e

View File

@ -14,9 +14,9 @@ public class SignalServiceStickerManifest {
private final List<StickerInfo> stickers; private final List<StickerInfo> stickers;
public SignalServiceStickerManifest(String title, String author, StickerInfo cover, List<StickerInfo> stickers) { public SignalServiceStickerManifest(String title, String author, StickerInfo cover, List<StickerInfo> stickers) {
this.title = Optional.of(title); this.title = Optional.fromNullable(title);
this.author = Optional.of(author); this.author = Optional.fromNullable(author);
this.cover = Optional.of(cover); this.cover = Optional.fromNullable(cover);
this.stickers = (stickers == null) ? Collections.<StickerInfo>emptyList() : new ArrayList<>(stickers); this.stickers = (stickers == null) ? Collections.<StickerInfo>emptyList() : new ArrayList<>(stickers);
} }