Skip to content

Conversation

@evdokim
Copy link
Contributor

@evdokim evdokim commented Dec 29, 2015

This additional check prevents invocation of indexOf() on possible null ref variable and improves therefore error messaging for malformed yaml files.

Before:

Cannot read property 'indexOf' of null

After:

Uncaught TypeError: Swagger 2.0 does not support null types

This additional check prevent invocation of `indexOf()` on possible null `ref` variable and improve therefore error messaging for malformed yaml files. 

Before:
```
Cannot read property 'indexOf' of null
```

After:
```
Uncaught TypeError: Swagger 2.0 does not support null types
```
@fehguy
Copy link
Contributor

fehguy commented Dec 29, 2015

Can you please add a test?

@evdokim
Copy link
Contributor Author

evdokim commented Dec 29, 2015

@fehguy I checked it by changing this line in swagger-ui.js and it works fine there.

fehguy added a commit that referenced this pull request Jan 14, 2016
an additional null check added
@fehguy fehguy merged commit ade27e7 into swagger-api:master Jan 14, 2016
fehguy added a commit that referenced this pull request Jan 14, 2016
@fehguy fehguy modified the milestone: v2.1.11 Jan 14, 2016
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

Successfully merging this pull request may close these issues.

2 participants