fix(Tracking): add null check
This commit is contained in:
parent
72d486e992
commit
499baeb496
|
@ -4,6 +4,7 @@ import android.net.Uri;
|
||||||
import android.util.Patterns;
|
import android.util.Patterns;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
|
|
||||||
|
@ -63,6 +64,8 @@ public class Tracking{
|
||||||
@NonNull
|
@NonNull
|
||||||
public static String removeTrackingParameters(@NonNull String url){
|
public static String removeTrackingParameters(@NonNull String url){
|
||||||
Uri uri=Uri.parse(url);
|
Uri uri=Uri.parse(url);
|
||||||
|
if(uri==null)
|
||||||
|
return url;
|
||||||
Uri.Builder uriBuilder=uri.buildUpon().clearQuery();
|
Uri.Builder uriBuilder=uri.buildUpon().clearQuery();
|
||||||
|
|
||||||
// Iterate over existing parameters and add them back if they are not tracking parameters
|
// Iterate over existing parameters and add them back if they are not tracking parameters
|
||||||
|
|
Loading…
Reference in New Issue