Skip to content

Commit 65fc6b4

Browse files
authored
fix(Spotify): Prevent hiding all navigation bar buttons (#5122)
1 parent 2257dd9 commit 65fc6b4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

extensions/spotify/src/main/java/app/revanced/extension/spotify/layout/hide/createbutton/HideCreateButtonPatch.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ public static Object returnNullIfIsCreateButton(Object navigationBarItem) {
3737
String matchedTitleResId = null;
3838

3939
for (String titleResId : CREATE_BUTTON_TITLE_RES_ID_LIST) {
40+
// In case the resource id has not been found.
41+
if (titleResId.equals("0")) {
42+
continue;
43+
}
44+
4045
if (stringifiedNavigationBarItem.contains(titleResId)) {
4146
isCreateButton = true;
4247
matchedTitleResId = titleResId;
@@ -58,6 +63,11 @@ public static Object returnNullIfIsCreateButton(Object navigationBarItem) {
5863
* Create button.
5964
*/
6065
public static boolean isOldCreateButton(int oldNavigationBarItemTitleResId) {
66+
// In case the resource id has not been found.
67+
if (OLD_CREATE_BUTTON_TITLE_RES_ID == 0) {
68+
return false;
69+
}
70+
6171
boolean isCreateButton = oldNavigationBarItemTitleResId == OLD_CREATE_BUTTON_TITLE_RES_ID;
6272

6373
if (isCreateButton) {

0 commit comments

Comments
 (0)