Skip to content

Fix server method registered as object without options#3702

Closed
devinivy wants to merge 1 commit intohapijs:masterfrom
devinivy:srv-method-no-opts-fix
Closed

Fix server method registered as object without options#3702
devinivy wants to merge 1 commit intohapijs:masterfrom
devinivy:srv-method-no-opts-fix

Conversation

@devinivy
Copy link
Member

@devinivy devinivy commented Nov 30, 2017

Currently (hapi v17.1.1, node v8, OSX) the following error occurs when attempting to register a server method of the form server.method({ name, method }) (without options),

      Cannot read property 'generateKey' of undefined

      at module.exports.internals.Methods._add (/hapi/lib/methods.js:51:40)
      at module.exports.internals.Methods.add (/hapi/lib/methods.js:37:18)
      at internals.Server.method (/hapi/lib/server.js:331:35)
      at it (/hapi/test/methods.js:98:16)

This PR offers a proposed fix and tests.

@hueniverse hueniverse self-assigned this Dec 20, 2017
@hueniverse hueniverse added the bug Bug or defect label Dec 20, 2017
@hueniverse hueniverse added this to the 17.1.2 milestone Dec 20, 2017
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Bug or defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants