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

Commit

Permalink
Fix uncaught 'variationErr is not defined' exception (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
SharkofMirkwood authored and eli-darkly committed Oct 5, 2018
1 parent 30ed614 commit a4dc34f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ var newClient = function(sdkKey, config) {
variationInternal(key, user, defaultVal, includeReasonsInEvents, resolve, reject);
} else {
var err = new errors.LDClientError("Variation called before LaunchDarkly client initialization completed (did you wait for the 'ready' event?) - using default value");
maybeReportError(variationErr);
maybeReportError(err);
var result = errorResult('CLIENT_NOT_READY', defaultVal);
sendFlagEvent(key, null, user, result, defaultVal, includeReasonsInEvents);
return resolve(result);
Expand All @@ -197,7 +197,7 @@ var newClient = function(sdkKey, config) {

else if (!key) {
err = new errors.LDClientError('No feature flag key specified. Returning default value.');
maybeReportError(variationError);
maybeReportError(err);
return resolve(errorResult('FLAG_NOT_FOUND', defaultVal));
}

Expand Down

0 comments on commit a4dc34f

Please sign in to comment.