Skip to content

Commit

Permalink
fix: Fix NPE when opening video from different App (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJeterLP committed Jul 5, 2022
1 parent 2710d50 commit 3c0408f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ private static Map<WhitelistType, Boolean> parseEnabledMap(Context context) {
}

private static boolean isWhitelisted(WhitelistType whitelistType) {
boolean isEnabled = enabledMap.get(whitelistType);
boolean isEnabled = false;
if(enabledMap.containsKey(whitelistType) && enabledMap.get(whitelistType) != null) {

This comment has been minimized.

Copy link
@oSumAtrIX

oSumAtrIX Jul 5, 2022

Member

Instead of calling .get twice, create a variable and set enabled if its not null

This comment has been minimized.

Copy link
@TheJeterLP

TheJeterLP Jul 5, 2022

Author Contributor

I will change that later on my PR 👍🏻

isEnabled = enabledMap.get(whitelistType);
}
if (!isEnabled) {
return false;
}
Expand Down Expand Up @@ -173,4 +176,4 @@ private static boolean updateWhitelist(WhitelistType whitelistType, ArrayList<Ch
public static void setEnabled(WhitelistType whitelistType, boolean enabled) {
enabledMap.put(whitelistType, enabled);
}
}
}

0 comments on commit 3c0408f

Please sign in to comment.