Skip to content

Commit

Permalink
Merge branch 'master' of github.com:launchdarkly/js-client
Browse files Browse the repository at this point in the history
  • Loading branch information
apucacao committed Oct 26, 2016
2 parents c269a28 + 80197ef commit 4973a3f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ function identify(user, hash, onDone) {

function variation(key, defaultValue) {
var value;

if (flags.hasOwnProperty(key)) {
if (flags && flags.hasOwnProperty(key)) {
value = flags[key] === null ? defaultValue : flags[key];
} else {
value = defaultValue;
Expand All @@ -101,6 +101,9 @@ function variation(key, defaultValue) {

function allFlags() {
var results = {};

if (!flags) { return results; }

for (var key in flags) {
if (flags.hasOwnProperty(key)) {
results[key] = variation(key, null);
Expand Down

0 comments on commit 4973a3f

Please sign in to comment.