Skip to content

Commit 5212544

Browse files
ParthivMangukiyaiamareebjamal
authored andcommitted
fix: Add on error image when header image not found (fossasia#2368)
1 parent a83c742 commit 5212544

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

android/app/src/main/java/org/fossasia/openevent/core/main/MainActivity.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,18 @@ private void setUpUserProfileMenu() {
326326
private void setNavHeader(Event event) {
327327
String logo = event.getLogoUrl();
328328
if (!Utils.isEmpty(logo)) {
329-
StrategyRegistry.getInstance().getHttpStrategy().getPicassoWithCache().load(logo).into(headerView);
329+
StrategyRegistry.getInstance()
330+
.getHttpStrategy()
331+
.getPicassoWithCache()
332+
.load(logo)
333+
.error(R.mipmap.ic_launcher)
334+
.into(headerView);
330335
} else {
331-
StrategyRegistry.getInstance().getHttpStrategy().getPicassoWithCache().load(R.mipmap.ic_launcher).into(headerView);
336+
StrategyRegistry.getInstance()
337+
.getHttpStrategy()
338+
.getPicassoWithCache()
339+
.load(R.mipmap.ic_launcher)
340+
.into(headerView);
332341
}
333342
}
334343

0 commit comments

Comments
 (0)