File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
app/src/main/java/io/compactd/client/models Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -65,13 +65,20 @@ public InputStream getImage (ArtworkSize size) {
6565 Database db = this .mManager .getDatabase (databaseName ());
6666 Document doc = db .getDocument (getId ());
6767 Revision rev = doc .getCurrentRevision ();
68- Attachment att = rev .getAttachment (size .getSize ());
69- if (att != null ) {
70- return att .getContent ();
68+ if (rev != null ) {
69+ Attachment att = rev .getAttachment (size .getSize ());
70+ if (att != null ) {
71+ return att .getContent ();
72+ }
7173 }
7274 } catch (CouchbaseLiteException ignored ) {
7375 }
74- return null ;
76+ try {
77+ return ((AndroidContext ) mManager .getContext ()).getWrappedContext ().getResources ().getAssets ().open ("album_fallback.jpg" );
78+ } catch (IOException e ) {
79+ e .printStackTrace ();
80+ return null ;
81+ }
7582 }
7683
7784}
You can’t perform that action at this time.
0 commit comments