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

Cannot read property 'isImmutable' of null #62

Closed
garthk opened this issue Jun 18, 2014 · 1 comment · Fixed by #70
Closed

Cannot read property 'isImmutable' of null #62

garthk opened this issue Jun 18, 2014 · 1 comment · Fixed by #70
Assignees
Labels
bug
Milestone

Comments

@garthk
Copy link

@garthk garthk commented Jun 18, 2014

Discovered during a misadventure with plugin.method with bind set:

This code in lib/index.js is vulnerable to Object.getPrototypeOf returning null:

            var proto = Object.getPrototypeOf(obj);
            if (proto.isImmutable) { // hoek/lib/index.js:45
                newObj = obj;
            }

The crash:

     TypeError: Cannot read property 'isImmutable' of null
      at Object.exports.clone (node_modules/hapi/node_modules/hoek/lib/index.js:45:22)
      at Object.exports.clone (node_modules/hapi/node_modules/hoek/lib/index.js:66:37)
      at Object.exports.clone (node_modules/hapi/node_modules/hoek/lib/index.js:66:37)
      at Object.exports.clone (node_modules/hapi/node_modules/hoek/lib/index.js:66:37)
      at Object.exports.clone (node_modules/hapi/node_modules/hoek/lib/index.js:66:37)
      at Object.exports.clone (node_modules/hapi/node_modules/hoek/lib/index.js:66:37)
      at Object.exports.clone (node_modules/hapi/node_modules/hoek/lib/index.js:66:37)
      at internals.Methods._add (node_modules/hapi/lib/methods.js:50:25)
      at internals.Methods.add (node_modules/hapi/lib/methods.js:23:49)
      at Object.root.method (node_modules/hapi/lib/pack.js:334:34)

I'm not sure what's being closed, there, but it's the _cache property of some object wearing:

  • _allowStale
  • _cache
  • _dispose
  • _itemCount
  • _length
  • _lengthCalculator
  • _lru
  • _lruList
  • _max
  • _maxAge
  • _mru

Would that be from lru-cache?

@arb

This comment has been minimized.

Copy link
Contributor

@arb arb commented Jul 31, 2014

@garthk is this still an issue? If so, can you post reproduction steps.

@arb arb closed this in #70 Jul 31, 2014
@hueniverse hueniverse added the bug label Aug 2, 2014
@hueniverse hueniverse added this to the 2.4.0 milestone Aug 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.