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 call method 'substr' of undefined #2

Closed
SamDecrock opened this issue Dec 27, 2013 · 2 comments
Closed

Cannot call method 'substr' of undefined #2

SamDecrock opened this issue Dec 27, 2013 · 2 comments
Labels

Comments

@SamDecrock
Copy link

Sometimes we get the following error:

TypeError: Cannot call method 'substr' of undefined
    at isMobileFallback (/var/www/ourproject/node_modules/mobile-detect/mobile-detect.js:338:62)
    at prepareDetectionCache (/var/www/ourproject/node_modules/mobile-detect/mobile-detect.js:362:13)
    at MobileDetect.mobile (/var/www/ourproject/node_modules/mobile-detect/mobile-detect.js:433:13)
hgoebl added a commit that referenced this issue Dec 27, 2013
@hgoebl
Copy link
Owner

hgoebl commented Dec 27, 2013

Fixed in code. If urgent you can replace mobile-detect.js in node_modules manually. Will publish a new npm version in ~2 hours (currently not on my PC).

@hgoebl hgoebl closed this as completed in 5620603 Dec 27, 2013
@SamDecrock
Copy link
Author

Its OK. I currently check for null/undefined before I create the MobileDetect object and check for mobile ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants