Fix importing entities from URL

This commit is contained in:
David Rowe 2017-10-18 17:44:36 +13:00
parent 52813d1abe
commit f74c33f597

View file

@ -1476,10 +1476,19 @@ function onFileSaveChanged(filename) {
function onFileOpenChanged(filename) {
// disconnect the event, otherwise the requests will stack up
Window.openFileChanged.disconnect(onFileOpenChanged);
try {
// Not all calls to onFileOpenChanged() connect an event.
Window.openFileChanged.disconnect(onFileOpenChanged)
} catch (e) {
// Ignore.
}
var importURL = null;
if (filename !== "") {
importURL = "file:///" + filename;
importURL = filename;
if (!/^(http|https):\/\//.test(filename)) {
importURL = "file:///" + importURL;
}
}
if (importURL) {
if (!isActive && (Entities.canRez() && Entities.canRezTmp())) {