Skip to content

Commit

Permalink
fix tag id corrupted if tag had custom icon
Browse files Browse the repository at this point in the history
  • Loading branch information
TBog committed Dec 14, 2022
1 parent e4d94af commit 2bc9699
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 4 additions & 3 deletions app/src/main/java/rocks/tbog/tblauncher/entry/TagEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ public TagEntry(@NonNull String id) {
super(id, 0);
if (BuildConfig.DEBUG) {
if (!id.startsWith(SCHEME))
throw new IllegalStateException("Invalid " + TagEntry.class.getSimpleName() + " id `" + id + "`");
if (!(this instanceof TagSortEntry) && TagSortEntry.isTagSort(id))
throw new IllegalStateException(TagEntry.class.getSimpleName() + " instantiated with id `" + id + "`");
throw new IllegalStateException("Invalid " + getClass().getSimpleName() + " id `" + id + "`");
if ((!(this instanceof TagSortEntry) && TagSortEntry.isTagSort(id))
|| ((this instanceof TagSortEntry) && !TagSortEntry.isTagSort(id)))
throw new IllegalStateException(getClass().getSimpleName() + " instantiated with id `" + id + "`");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,7 @@ public boolean changeTagSort(String tagId, String newTagId) {
TagsProvider tagsProvider = dataHandler.getTagsProvider();
if (tagsProvider != null) {
tagEntry = tagsProvider.findById(tagId);
if (tagEntry != null && tagEntry.hasCustomIcon()) {
newEntry = tagsProvider.getTagEntry(newTagId);
}
newEntry = tagsProvider.findById(newTagId);
}
if (tagEntry == null)
tagEntry = TagsProvider.newTagEntryCheckId(tagId);
Expand Down

0 comments on commit 2bc9699

Please sign in to comment.