From a8325735a3ca24f004866512b32d3ec8c303e366 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Tue, 14 Feb 2017 22:10:24 +0100 Subject: [PATCH] Fixed NPE from DocumentFileManager.isSticker. #30. --- .../telegram_backup/mediafilemanager/DocumentFileManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/de/fabianonline/telegram_backup/mediafilemanager/DocumentFileManager.java b/src/main/java/de/fabianonline/telegram_backup/mediafilemanager/DocumentFileManager.java index 143a9b5..0559cc7 100644 --- a/src/main/java/de/fabianonline/telegram_backup/mediafilemanager/DocumentFileManager.java +++ b/src/main/java/de/fabianonline/telegram_backup/mediafilemanager/DocumentFileManager.java @@ -60,6 +60,7 @@ public class DocumentFileManager extends AbstractMediaFileManager { public boolean isSticker() { TLDocumentAttributeSticker sticker = null; + if (this.isEmpty || doc==null) return false; if (doc.getAttributes() != null) for(TLAbsDocumentAttribute attr : doc.getAttributes()) { if (attr instanceof TLDocumentAttributeSticker) { sticker = (TLDocumentAttributeSticker)attr;