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

router里的isObjectEqual方法,当对象属性的值为null时,会报错 #1552

Closed
tomatoo1 opened this issue Jun 29, 2017 · 5 comments
Closed

Comments

@tomatoo1
Copy link

Version

2.7.0

Reproduction link

https://jsfiddle.net/50wL7mdz/43712/

Steps to reproduce

isObjectEquals方法没写好

What is expected?

不报错

What is actually happening?

报nullpointer


router里的isObjectEqual方法,当对象属性的值为null时,会报错

@posva
Copy link
Member

posva commented Jun 29, 2017

Hi!
Please make sure to follow the Issue Reporting Guidelines before opening an issue. That repro is only doing alert(typeof null)
Thanks!

@posva posva closed this as completed Jun 29, 2017
@tomatoo1
Copy link
Author

Hi,
the bug is very simple. In the latest release of vue router. A method named isObjectEqual has bug. It use typeof to judge if an variable is object. But when the variable is null, typeof will return object! This will cause nullpointer exception.

@posva
Copy link
Member

posva commented Jun 30, 2017

well, in that case please point out where the problem or a jsfiddle showcasing the problem

@anhzhi
Copy link

anhzhi commented Jul 5, 2017

assert isObjectEqual( {q: "", from: null, to: null}, {q: "", from: null, to: null})===true

please add this test Case

i wish that vue-router supports url like "http://host:port/dashboards?q=&from&to"

i get a work around way:
isObjectEqual( {q: "", from: undefined, to: undefined}, {q: "", from: undefined, to: undefined})
while the url looks like http://192.168.10.40:8221/dashboards?q=&from&to

@CzBiX
Copy link

CzBiX commented Jul 5, 2017

I just create a new issue about this problem, please see #1566.

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

4 participants