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 ac = savedFacet.actor;
|
||||
return function () {
|
||||
let actuals = arguments;
|
||||
ac.dataspace.start();
|
||||
ac.pushScript(function () {
|
||||
Dataspace.withCurrentFacet(savedFacet, function () {
|
||||
f.apply(this, actuals);
|
||||
if (savedFacet.isLive) {
|
||||
let actuals = arguments;
|
||||
ac.dataspace.start();
|
||||
ac.pushScript(function () {
|
||||
Dataspace.withCurrentFacet(savedFacet, function () {
|
||||
f.apply(this, actuals);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue