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

Commit

Permalink
prepare 7.1.6 release (#224)
Browse files Browse the repository at this point in the history
## [7.1.6] - 2023-06-22
### Fixed:
- Fix #160 null pointer exceptions on `getLastSuccessfulConnection` and
`getLastFailedConnection`

---------

Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: Ember Stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Yusinto Ngadiman <yusinto@gmail.com>
Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>
  • Loading branch information
5 people authored Jun 22, 2023
1 parent 80d1d9f commit 2c8c628
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## LaunchDarkly overview

[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today!
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves trillions of feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today!

[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)

Expand All @@ -24,7 +24,7 @@ Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/client-side/r

## Learn more

Check out our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/sdk/client-side/react/react-native).
Read our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/sdk/client-side/react/react-native).

## Testing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import com.launchdarkly.sdk.android.LDConfig;
import com.launchdarkly.sdk.android.LDFailure;
import com.launchdarkly.sdk.android.LDStatusListener;
import com.launchdarkly.sdk.android.LaunchDarklyException;
import com.launchdarkly.sdk.android.integrations.ApplicationInfoBuilder;
import com.launchdarkly.sdk.android.integrations.EventProcessorBuilder;
import com.launchdarkly.sdk.android.integrations.HttpConfigurationBuilder;
Expand Down Expand Up @@ -636,7 +635,12 @@ public void getConnectionMode(String environment, Promise promise) {
@ReactMethod
public void getLastSuccessfulConnection(String environment, Promise promise) {
try {
promise.resolve(LDClient.getForMobileKey(environment).getConnectionInformation().getLastSuccessfulConnection().intValue());
Long lastSuccessfulConnection = LDClient.getForMobileKey(environment).getConnectionInformation().getLastSuccessfulConnection();
if (lastSuccessfulConnection != null) {
promise.resolve(lastSuccessfulConnection.doubleValue());
} else {
promise.resolve(null);
}
} catch (Exception e) {
Timber.w(e, "Warning: exception caught in getLastSuccessfulConnection");
promise.resolve(0);
Expand All @@ -646,7 +650,13 @@ public void getLastSuccessfulConnection(String environment, Promise promise) {
@ReactMethod
public void getLastFailedConnection(String environment, Promise promise) {
try {
promise.resolve(LDClient.getForMobileKey(environment).getConnectionInformation().getLastFailedConnection().intValue());
Long lastFailedConnection = LDClient.getForMobileKey(environment).getConnectionInformation().getLastFailedConnection();
if (lastFailedConnection != null) {
promise.resolve(lastFailedConnection.doubleValue());
} else {
promise.resolve(null);
}

} catch (Exception e) {
Timber.w(e, "Warning: exception caught in getLastFailedConnection");
promise.resolve(0);
Expand Down

0 comments on commit 2c8c628

Please sign in to comment.