Skip to content

fix - JS error "values of undefined" on a missing reference in a column#751

Merged
fzaninotto merged 1 commit intomarmelab:masterfrom
kenegozi:missing-reference
Oct 29, 2015
Merged

fix - JS error "values of undefined" on a missing reference in a column#751
fzaninotto merged 1 commit intomarmelab:masterfrom
kenegozi:missing-reference

Conversation

@kenegozi
Copy link
Copy Markdown
Contributor

fixes #750

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

scope.value = scope.entry.values ? scope.entry.values[scope.field.name()] : ''; is better IMO.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it's not that .values is undefined, it's that .entry is undefined, so the one-liner will still end up with Uncaught TypeError: Cannot read property 'values' of undefined

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

as for relying on truethiness vs. checking typeof, this could turn into a holy war which is far from my intent, so whichever is consistent with the project's guidelines is fine by me.

@kenegozi kenegozi closed this Oct 26, 2015
@kenegozi kenegozi reopened this Oct 26, 2015
@fzaninotto
Copy link
Copy Markdown
Member

I really don't understand why the build fails on this PR. I've restarted it three times.

Could you try rebasing on master?

@kenegozi
Copy link
Copy Markdown
Contributor Author

rebased, still same failure. I have no idea what's causing it.

fzaninotto added a commit that referenced this pull request Oct 29, 2015
fix - JS error "values of undefined" on a missing reference in a column
@fzaninotto fzaninotto merged commit b75ba9e into marmelab:master Oct 29, 2015
@fzaninotto
Copy link
Copy Markdown
Member

OK, merging with hope that the faulty CI worker was only on your branch...

@kenegozi
Copy link
Copy Markdown
Contributor Author

Thanks.

This is so weird. I can't explain it.

@kenegozi kenegozi deleted the missing-reference branch October 29, 2015 13:34
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.

reference field column - js error on missing entry

3 participants