Skip to content

Commit f9e5c67

Browse files
committed
Null checks the image url before loading via picasso.
1 parent 77cd71b commit f9e5c67

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/IterableInAppManager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ static void showFullScreenDialog(Context context, JSONObject dialogParameters, S
156156
verticalLayout.addView(imageView);
157157
try {
158158
Class picassoClass = Class.forName(IterableConstants.PICASSO_CLASS);
159-
if (picassoClass != null) {
160-
159+
if (picassoClass != null && dialogParameters.optString(IterableConstants.ITERABLE_IN_APP_MAIN_IMAGE) != null) {
161160
Picasso.
162161
with(context.getApplicationContext()).
163162
load(dialogParameters.optString(IterableConstants.ITERABLE_IN_APP_MAIN_IMAGE)).

iterableapi/src/main/java/com/iterable/iterableapi/IterableNotification.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public Notification build() {
4545
handler.post(new Runnable() {
4646
@Override
4747
public void run() {
48-
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) {
48+
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN && imageUrl != null) {
4949
final RemoteViews bigContentView = notification.bigContentView;
5050
try {
5151
Class picassoClass = Class.forName(IterableConstants.PICASSO_CLASS);
@@ -105,7 +105,7 @@ public static IterableNotification createNotification(Context context, Bundle ex
105105
.setContentTitle(applicationName)
106106
.setPriority(Notification.PRIORITY_HIGH)
107107
.setContentText(notificationBody);
108-
108+
109109
if (pushImage != null) {
110110
notificationBuilder.imageUrl = pushImage;
111111
notificationBuilder.setContentText(notificationBody)

0 commit comments

Comments
 (0)