Skip to content

Commit

Permalink
get back "event.sender.isDestroyed" check
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimiry committed Aug 2, 2019
1 parent c00c154 commit 157fc10
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electron-rpc-api",
"version": "6.0.0-beta2",
"version": "6.0.0-beta3",
"description": "Wrapper around the Electron's IPC for building type-safe API based RPC-like and reactive interactions",
"author": "Vladimir Yakovlev <[email protected]> (https://github.com/vladimiry)",
"license": "MIT",
Expand Down Expand Up @@ -46,7 +46,7 @@
},
"devDependencies": {
"@email-securely-app/import-sort-style": "^0.1.0",
"@types/node": "^12.6.2",
"@types/node": "^12.6.9",
"@types/sinon": "^7.0.13",
"ava": "^1.2.1",
"cross-env": "^5.2.0",
Expand Down
8 changes: 7 additions & 1 deletion src/lib/ipc-main-api-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ export function createIpcMainApiService<AD extends Lib.Model.ApiDefinition<AD>,
payload,
emitter: {
emit: (...args) => {
event.reply(...args);
if (!event.sender.isDestroyed()) {
event.reply(...args);
return;
}
if (logger) {
logger.warn(`[${PM.MODULE_NAME}]`, `Object has been destroyed: "sender"`);
}
},
},
};
Expand Down
32 changes: 16 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -444,15 +444,15 @@
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==

"@types/node@*", "@types/node@^12.6.2":
version "12.6.8"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.8.tgz#e469b4bf9d1c9832aee4907ba8a051494357c12c"
integrity sha512-aX+gFgA5GHcDi89KG5keey2zf0WfZk/HAQotEamsK2kbey+8yGKcson0hbK8E+v0NArlCJQCqMP161YhV6ZXLg==
"@types/node@*", "@types/node@^12.6.9":
version "12.6.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.9.tgz#ffeee23afdc19ab16e979338e7b536fdebbbaeaf"
integrity sha512-+YB9FtyxXGyD54p8rXwWaN1EWEyar5L58GlGWgtH2I9rGmLGBQcw63+0jw+ujqVavNuO47S1ByAjm9zdHMnskw==

"@types/node@^10.12.18":
version "10.14.13"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.13.tgz#ac786d623860adf39a3f51d629480aacd6a6eec7"
integrity sha512-yN/FNNW1UYsRR1wwAoyOwqvDuLDtVXnaJTZ898XIw/Q5cCaeVAlVwvsmXLX5PuiScBYwZsZU4JYSHB3TvfdwvQ==
version "10.14.14"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.14.tgz#a47955df2acf76ba7f0ac3b205d325da193dc9ad"
integrity sha512-xXD08vZsvpv4xptQXj1+ky22f7ZoKu5ZNI/4l+/BXG3X+XaeZsmaFbbTKuhSE3NjjvRuZFxFf9sQBMXIcZNFMQ==

"@types/normalize-package-data@^2.4.0":
version "2.4.0"
Expand Down Expand Up @@ -4680,9 +4680,9 @@ pseudomap@^1.0.2:
integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM=

psl@^1.1.24:
version "1.2.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.2.0.tgz#df12b5b1b3a30f51c329eacbdef98f3a6e136dc6"
integrity sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA==
version "1.3.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.3.0.tgz#e1ebf6a3b5564fa8376f3da2275da76d875ca1bd"
integrity sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag==

public-encrypt@^4.0.0:
version "4.0.3"
Expand Down Expand Up @@ -5034,9 +5034,9 @@ resolve-url@^0.2.1:
integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=

resolve@^1.10.0, resolve@^1.3.2, resolve@^1.8.1:
version "1.11.1"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e"
integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==
version "1.12.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6"
integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==
dependencies:
path-parse "^1.0.6"

Expand Down Expand Up @@ -5620,9 +5620,9 @@ symbol-observable@^1.0.4, symbol-observable@^1.1.0:
integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==

table@^5.2.3:
version "5.4.4"
resolved "https://registry.yarnpkg.com/table/-/table-5.4.4.tgz#6e0f88fdae3692793d1077fd172a4667afe986a6"
integrity sha512-IIfEAUx5QlODLblLrGTTLJA7Tk0iLSGBvgY8essPRVNGHAzThujww1YqHLs6h3HfTg55h++RzLHH5Xw/rfv+mg==
version "5.4.5"
resolved "https://registry.yarnpkg.com/table/-/table-5.4.5.tgz#c8f4ea2d8fee08c0027fac27b0ec0a4fe01dfa42"
integrity sha512-oGa2Hl7CQjfoaogtrOHEJroOcYILTx7BZWLGsJIlzoWmB2zmguhNfPJZsWPKYek/MgCxfco54gEi31d1uN2hFA==
dependencies:
ajv "^6.10.2"
lodash "^4.17.14"
Expand Down

0 comments on commit 157fc10

Please sign in to comment.