Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Added try/catch when TileLoadingInterceptor tries to get country code #1183

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.MissingResourceException;

import okhttp3.Interceptor;
import okhttp3.Request;
Expand Down Expand Up @@ -101,7 +102,11 @@ private static String getMetadata() {
metaData.addProperty("device", Build.MODEL);
metaData.addProperty("version", Build.VERSION.RELEASE);
metaData.addProperty("abi", Build.CPU_ABI);
metaData.addProperty("country", Locale.getDefault().getISO3Country());
try {
metaData.addProperty("country", Locale.getDefault().getISO3Country());
} catch (MissingResourceException exception) {
metaData.addProperty("country", "none");
}
metaData.addProperty("ram", getRam());
metaData.addProperty("screenSize", getWindowSize());
metaData.addProperty("buildFlavor", BuildConfig.FLAVOR);
Expand Down