We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee7f939 commit a87991cCopy full SHA for a87991c
electron_app/src/socketClient.js
@@ -126,8 +126,14 @@ const checkAlive = () => {
126
(err, stdout, stderr) => {
127
let totalLost = 0;
128
if (stdout) {
129
- const [lostPackages] = stdout.toString().match(percentRegex);
130
- totalLost = Number(lostPackages.replace('%', ''));
+ const stdoutString = stdout.toString();
+ if (stdoutString) {
131
+ const match = stdoutString.match(percentRegex);
132
+ if (match) {
133
+ const [lostPackages] = match;
134
+ totalLost = Number(lostPackages.replace('%', ''));
135
+ }
136
137
}
138
if (err !== null || !!stderr || totalLost > 50) {
139
if (pingFailedCounter === 0) {
0 commit comments