Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Use hasInstance on public static getters of Mapbox.java (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun authored Jan 7, 2020
1 parent d8fc70e commit 2da60d2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static void setAccessToken(String accessToken) {
* @return the SKU token
*/
public static String getSkuToken() {
if (INSTANCE.accounts == null) {
if (!hasInstance() || INSTANCE.accounts == null) {
throw new MapboxConfigurationException(
"A valid access token parameter is required when using a Mapbox service."
+ "\nPlease see https://www.mapbox.com/help/create-api-access-token/ to learn how to create one."
Expand Down Expand Up @@ -179,7 +179,7 @@ private static void initializeTelemetry() {
*/
@Nullable
public static TelemetryDefinition getTelemetry() {
return INSTANCE.telemetry;
return hasInstance() ? INSTANCE.telemetry : null;
}

/**
Expand Down

0 comments on commit 2da60d2

Please sign in to comment.