Fix crashing bugs

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2019-01-29 14:42:34 +01:00
parent 85a5278f79
commit 213c7ea520
4 changed files with 66 additions and 59 deletions

View File

@ -475,6 +475,7 @@ public class CallNotificationController extends BaseController {
break;
case ROOM_GROUP_CALL:
if (avatarImageView != null) {
GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext())
.asBitmap()
.diskCacheStrategy(DiskCacheStrategy.NONE)
@ -483,7 +484,9 @@ public class CallNotificationController extends BaseController {
.override(avatarSize, avatarSize)
.apply(RequestOptions.bitmapTransform(new CircleCrop()))
.into(avatarImageView);
}
case ROOM_PUBLIC_CALL:
if (avatarImageView != null) {
GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext())
.asBitmap()
.diskCacheStrategy(DiskCacheStrategy.NONE)
@ -492,6 +495,7 @@ public class CallNotificationController extends BaseController {
.override(avatarSize, avatarSize)
.apply(RequestOptions.bitmapTransform(new CircleCrop()))
.into(avatarImageView);
}
break;
default:
}

View File

@ -333,7 +333,7 @@ public class ConversationInfoController extends BaseController {
}
private void loadConversationAvatar() {
if (conversationAvatarImageView != null) {
switch (conversation.getType()) {
case ROOM_TYPE_ONE_TO_ONE_CALL:
if (!TextUtils.isEmpty(conversation.getName())) {
@ -360,4 +360,5 @@ public class ConversationInfoController extends BaseController {
break;
}
}
}
}

View File

@ -190,6 +190,7 @@ public class ConversationsListController extends BaseController implements Searc
if (getActivity() != null) {
int avatarSize = (int) DisplayUtils.convertDpToPixel(menuItem.getIcon().getIntrinsicHeight(), getActivity());
if (currentUser != null) {
GlideUrl glideUrl = new GlideUrl(ApiUtils.getUrlForAvatarWithNameAndPixels(currentUser.getBaseUrl(),
currentUser.getUserId(), avatarSize), new LazyHeaders.Builder()
.setHeader("Accept", "image/*")
@ -210,6 +211,7 @@ public class ConversationsListController extends BaseController implements Searc
});
}
}
}
@Override
protected void onAttach(@NonNull View view) {

View File

@ -208,7 +208,7 @@ public class WebViewLoginController extends BaseController {
basePageLoaded = true;
}
if (!TextUtils.isEmpty(username)) {
if (!TextUtils.isEmpty(username) && webView != null) {
if (loginStep == 1) {
webView.loadUrl("javascript: {document.getElementsByClassName('login')[0].click(); };");
} else if (!automatedLoginAttempted) {