Browse Source

Fix a crash issue

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 6 năm trước cách đây
mục cha
commit
ca72cd5cd0

+ 6 - 2
app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java

@@ -453,7 +453,9 @@ public class CallNotificationController extends BaseController {
                                     script.forEach(output);
                                     output.copyTo(resource);
 
-                                    backgroundImageView.setImageDrawable(new BitmapDrawable(resource));
+                                    if (backgroundImageView != null) {
+                                        backgroundImageView.setImageDrawable(new BitmapDrawable(resource));
+                                    }
                                 } else if (AvatarStatusCodeHolder.getInstance().getStatusCode() == 201) {
                                     ColorArt colorArt = new ColorArt(resource);
                                     int color = colorArt.getBackgroundColor();
@@ -463,7 +465,9 @@ public class CallNotificationController extends BaseController {
                                     hsv[2] *= 0.75f;
                                     color = Color.HSVToColor(hsv);
 
-                                    backgroundImageView.setImageDrawable(new ColorDrawable(color));
+                                    if (backgroundImageView != null) {
+                                        backgroundImageView.setImageDrawable(new ColorDrawable(color));
+                                    }
                                 }
                             }
                         });