Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle if null initialization callback #45

Merged
merged 1 commit into from Apr 10, 2024
Merged

Conversation

aarsilv
Copy link
Contributor

@aarsilv aarsilv commented Apr 10, 2024

There is one spot--where we successfully load the configuration from the file cache--where we don't check if the initialization callback is defined before attempting to call it. This adds in that check.

@@ -167,6 +167,7 @@ public void onError(String errorMessage) {
})
.buildAndInit();

// Wait for initialization to succeed or fail, up to 10 seconds, before continuing
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated, but threw in this helpful comment too

@@ -4,7 +4,7 @@ plugins {
}

group = "cloud.eppo"
version = "1.0.6"
version = "1.0.7"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remembering to bump the version in the same PR! 🎉

@@ -29,7 +29,9 @@ public void load(InitializationCallback callback) {
@Override
public void onCacheLoadSuccess() {
cachedUsed.set(true);
callback.onCompleted();
if (callback != null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix

(The other two places already have it)

@aarsilv aarsilv merged commit b8f086b into main Apr 10, 2024
1 check passed
@aarsilv aarsilv deleted the aaron/ff-1899/check-callback branch April 10, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants