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

fix(endpoint:controller): wrap saveUpdates in an if(entity) statement #2059

Closed
wants to merge 1 commit into from

Conversation

wkevwang
Copy link

@wkevwang wkevwang commented Jul 13, 2016

Regarding issue #2052

Fixes issue in endpoint controller - when handleEntityNotFound returns null if the entity is not found, it causes saveUpdates to throw an error since updated.save() is called on null. This will result in a 500 response when the entity is not found, instead of the expected 404.

Wrapping saveUpdates in if(entity) will make it return with undefined when the entity is null, which solves the issue.

@Awk34 Awk34 added the V3 label Sep 13, 2016
Awk34 pushed a commit that referenced this pull request Sep 13, 2016
@Awk34 Awk34 closed this Sep 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants