Fix crashes

This commit is contained in:
Thomas 2023-01-02 15:06:31 +01:00
parent cbc5eddc9c
commit 64e50bd8b5
3 changed files with 15 additions and 4 deletions

View File

@ -183,6 +183,12 @@ public class PinnedTimelineHelper {
if (extraFeatures) {
try {
Pinned pinnedAll = new Pinned(activity).getAllPinned(currentAccount);
if (pinnedAll == null) {
pinnedAll = new Pinned();
pinnedAll.user_id = currentUserID;
pinnedAll.instance = currentInstance;
pinnedAll.pinnedTimelines = new ArrayList<>();
}
boolean createDefaultBubbleAtTop = true;
for (PinnedTimeline pinnedTimeline : pinnedAll.pinnedTimelines) {
if (pinnedTimeline.type == Timeline.TimeLineEnum.BUBBLE) {

View File

@ -299,6 +299,9 @@ public class SpannableHelper {
}
int matchEnd = start + newUrl.length();
String finalUrl = url;
if (content.length() < matchEnd) {
matchEnd = content.length();
}
content.setSpan(new LongClickableSpan() {
@Override
public void onLongClick(View view) {

View File

@ -718,10 +718,12 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
timelineParams.remote = true;
break;
case BUBBLE:
timelineParams.onlyMedia = bubbleTimeline.only_media;
timelineParams.remote = bubbleTimeline.remote;
timelineParams.replyVisibility = bubbleTimeline.reply_visibility;
timelineParams.excludeVisibilities = bubbleTimeline.exclude_visibilities;
if (bubbleTimeline != null) {
timelineParams.onlyMedia = bubbleTimeline.only_media;
timelineParams.remote = bubbleTimeline.remote;
timelineParams.replyVisibility = bubbleTimeline.reply_visibility;
timelineParams.excludeVisibilities = bubbleTimeline.exclude_visibilities;
}
break;
case LIST:
timelineParams.listId = list_id;