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

if router query have null or undefined value, will throw error #1725

Closed
svkd9 opened this issue Sep 8, 2017 · 1 comment
Closed

if router query have null or undefined value, will throw error #1725

svkd9 opened this issue Sep 8, 2017 · 1 comment

Comments

@svkd9
Copy link

svkd9 commented Sep 8, 2017

Version

2.7.0

Reproduction link

https://github.com/vuejs/vue-router/blob/v2.7.0/src/util/route.js#L86

Steps to reproduce

const routerQuery = {
a: null,
b: undefined
}
this.$router.push({name: 'routerName', query: routerQuery})

What is expected?

no error

What is actually happening?

throw error 'Cannot convert undefined or null to object'


i think the problem maybe in https://github.com/vuejs/vue-router/blob/v2.7.0/src/util/route.js#L86

typeof aVal === 'object' ====> Object.prototype.toString.call(aVal) === '[object Object]'

@posva
Copy link
Member

posva commented Sep 8, 2017

Dup of some other issue, PR to fix this at #1568

@posva posva closed this as completed Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants