Prevent wrapExternal from triggering if recipient facet is no longer alive
This commit is contained in:
parent
b85ba4a9f0
commit
aebf989e8d
|
@ -100,13 +100,15 @@ Dataspace.wrapExternal = function (f) {
|
||||||
let savedFacet = Dataspace._currentFacet;
|
let savedFacet = Dataspace._currentFacet;
|
||||||
let ac = savedFacet.actor;
|
let ac = savedFacet.actor;
|
||||||
return function () {
|
return function () {
|
||||||
let actuals = arguments;
|
if (savedFacet.isLive) {
|
||||||
ac.dataspace.start();
|
let actuals = arguments;
|
||||||
ac.pushScript(function () {
|
ac.dataspace.start();
|
||||||
Dataspace.withCurrentFacet(savedFacet, function () {
|
ac.pushScript(function () {
|
||||||
f.apply(this, actuals);
|
Dataspace.withCurrentFacet(savedFacet, function () {
|
||||||
|
f.apply(this, actuals);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue