Skip to content

Conversation

thomaszurkan-optimizely
Copy link
Contributor

unit tests added as well.

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

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

Looks mostly good, just have one small thing to fix

* @return the live variable to retrieve for the given variable key
*
*/
private LiveVariable getLiveVariable(ProjectConfig projectConfig, String variableKey) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should null-check the variableKey since it is a user-provided input or we can do it at a higher level, like the caller of this function

@NonNull Map<String, String> attributes,
boolean activateExperiment) {

if (!isValid()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's null-check the userId and variableKey input params here

}

if (variableKey == null || variableKey.isEmpty()) {
logger.warn("Invalid live variable key (null or empty) " +
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd make the argument for making these error logs so the developer will be more inclined to fix it or null-check on their end before passing to us.

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

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

lgtm, just one more suggestion

@thomaszurkan-optimizely thomaszurkan-optimizely merged commit e4c140a into master Jun 7, 2018
@thomaszurkan-optimizely thomaszurkan-optimizely deleted the fix/getVariableXXX branch June 7, 2018 21:14
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.

3 participants