mirror of
https://github.com/maputnik/editor.git
synced 2026-06-15 19:57:27 +00:00
Added try/catch around mapboxUtil.normalizeSourceURL
This commit is contained in:
@@ -203,7 +203,12 @@ export default class App extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(!this.state.sources.hasOwnProperty(key) && val.type === "vector") {
|
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)
|
fetch(url)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user