fix: fixes crashes when adding a hashtag timeline

Closes #308
This commit is contained in:
LucasGGamerM 2023-12-06 15:20:22 -03:00
parent 69a2fc2d9f
commit 533032ca75
1 changed files with 2 additions and 2 deletions

View File

@ -378,7 +378,7 @@ public class EditTimelinesFragment extends MastodonRecyclerFragment<TimelineDefi
String name=editText.getText().toString().trim(); String name=editText.getText().toString().trim();
String mainHashtag=tagMain.getText().toString().trim(); String mainHashtag=tagMain.getText().toString().trim();
if(item.getType()==TimelineDefinition.TimelineType.HASHTAG){ if(item != null && item.getType()==TimelineDefinition.TimelineType.HASHTAG){
tagsAny.chipifyAllUnterminatedTokens(); tagsAny.chipifyAllUnterminatedTokens();
tagsAll.chipifyAllUnterminatedTokens(); tagsAll.chipifyAllUnterminatedTokens();
tagsNone.chipifyAllUnterminatedTokens(); tagsNone.chipifyAllUnterminatedTokens();
@ -397,7 +397,7 @@ public class EditTimelinesFragment extends MastodonRecyclerFragment<TimelineDefi
TimelineDefinition.Icon icon=TimelineDefinition.Icon.values()[(int) btn.getTag()]; TimelineDefinition.Icon icon=TimelineDefinition.Icon.values()[(int) btn.getTag()];
tl.setIcon(icon); tl.setIcon(icon);
tl.setTitle(name); tl.setTitle(name);
if(item.getType()==TimelineDefinition.TimelineType.HASHTAG){ if(item == null || item.getType()==TimelineDefinition.TimelineType.HASHTAG){
tl.setTagOptions( tl.setTagOptions(
mainHashtag, mainHashtag,
tagsAny.getChipValues(), tagsAny.getChipValues(),