Added try/catch around mapboxUtil.normalizeSourceURL

This commit is contained in:
orangemug 2018-01-25 19:40:54 +00:00
parent 9d96525f12
commit 0ebb299fd0

View file

@ -203,7 +203,12 @@ export default class App extends React.Component {
};
if(!this.state.sources.hasOwnProperty(key) && val.type === "vector") {
const url = mapboxUtil.normalizeSourceURL(val.url, MapboxGl.accessToken);
let url = val.url;
try {
url = mapboxUtil.normalizeSourceURL(url, MapboxGl.accessToken);
} catch(err) {
console.warn("Failed to normalizeSourceURL: ", err);
}
fetch(url)
.then((response) => {