|
4 | 4 | import android.os.Parcelable; |
5 | 5 | import android.support.annotation.IntRange; |
6 | 6 | import android.support.annotation.NonNull; |
| 7 | +import android.support.annotation.Nullable; |
7 | 8 |
|
8 | 9 | import com.afollestad.bridge.annotations.Body; |
9 | 10 | import com.proxerme.library.interfaces.IdItem; |
@@ -55,20 +56,25 @@ public Conference[] newArray(int size) { |
55 | 56 | } |
56 | 57 |
|
57 | 58 | public Conference(@NonNull String id, @NonNull String topic, @NonNull String customTopic, |
58 | | - @IntRange(from = 2) int participantAmount, @NonNull String imageType, |
59 | | - @NonNull String imageId, boolean isGroup, boolean isRead, long time, |
| 59 | + @IntRange(from = 2) int participantAmount, @Nullable String imageType, |
| 60 | + @Nullable String imageId, boolean isGroup, boolean isRead, long time, |
60 | 61 | @IntRange(from = 0) int unreadMessageAmount, |
61 | 62 | @NonNull String lastReadMessageId) { |
62 | 63 | this.id = id; |
63 | 64 | this.topic = topic; |
64 | 65 | this.customTopic = customTopic; |
65 | 66 | this.participantAmount = participantAmount; |
66 | | - this.image = imageType + ":" + imageId; |
67 | 67 | this.isGroup = isGroup; |
68 | 68 | this.isRead = isRead; |
69 | 69 | this.time = time; |
70 | 70 | this.unreadMessageAmount = unreadMessageAmount; |
71 | 71 | this.lastReadMessageId = lastReadMessageId; |
| 72 | + |
| 73 | + if (imageType == null || imageType.isEmpty() || imageId == null || imageType.isEmpty()) { |
| 74 | + this.image = ""; |
| 75 | + } else { |
| 76 | + this.image = imageType + ":" + imageId; |
| 77 | + } |
72 | 78 | } |
73 | 79 |
|
74 | 80 | protected Conference(Parcel in) { |
|
0 commit comments