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

Article middleware was calling getErrorMessage with a null argument #720

Merged
merged 1 commit into from
Jul 29, 2015
Merged

Article middleware was calling getErrorMessage with a null argument #720

merged 1 commit into from
Jul 29, 2015

Conversation

vaucouleur
Copy link
Contributor

The article middleware was calling getErrorMessage with a null argument, causing a crash when this method tried to access 'code' on an null parameter.

The bug was not exposed by the original test, since it was mixing two (related) aspects:

  • An invalid Id (a badly formed mongodb identifier)
  • An non-existent Id (an identifier with no corresponding document in the database)

Modifications:

  • Fixed the message property in the article controller (the error message follows the wording of the error message in "users.password.server.controller.js", in case of username not found)
  • Added a new test to check modifications and avoid regressions

…nt, causing a crash when this method tried to access 'code' on an null parameter.

The bug was not exposed by the original test, since it was mixing two (related) aspects:

* An invalid Id (a badly formed mongodb identifier)
* An non-existent Id (an identifier with no corresponding document in the database)

Modifications:

- Fixed the message property in the article controller (the error message follows the wording of the error message in "users.password.server.controller.js", in case of username not found)
- Added a new test to check modifications and avoid regressions
@ilanbiala
Copy link
Member

@lirantal LGTM.

@lirantal
Copy link
Member

Thanks guys.

lirantal added a commit that referenced this pull request Jul 29, 2015
Article middleware was calling getErrorMessage with a null argument
@lirantal lirantal merged commit 09870db into meanjs:0.4.0 Jul 29, 2015
@vaucouleur vaucouleur deleted the getErrorMessage branch August 24, 2015 09:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants