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) { if (extraFeatures) {
try { try {
Pinned pinnedAll = new Pinned(activity).getAllPinned(currentAccount); 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; boolean createDefaultBubbleAtTop = true;
for (PinnedTimeline pinnedTimeline : pinnedAll.pinnedTimelines) { for (PinnedTimeline pinnedTimeline : pinnedAll.pinnedTimelines) {
if (pinnedTimeline.type == Timeline.TimeLineEnum.BUBBLE) { if (pinnedTimeline.type == Timeline.TimeLineEnum.BUBBLE) {

View File

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

View File

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