Skip to content

Commit 5555ac0

Browse files
author
Javier Acuna
committed
Merge branch 'develop' into 'master'
Develop See merge request prey/js/prey-node-client!1230
2 parents dc8e4a5 + 7b30bb1 commit 5555ac0

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## [v1.13.15](https://github.com/prey/prey-node-client/tree/v1.13.14) (2025-05-28)
4+
[Full Changelog](https://github.com/prey/prey-node-client/compare/v1.13.13..v1.13.14)
5+
6+
- Fix: Fixes error on empty file for log retrieval action. ([Beregcamlost](https://github.com/beregcamlost)) ([SoraKenji](https://github.com/SoraKenji))
7+
8+
39
## [v1.13.14](https://github.com/prey/prey-node-client/tree/v1.13.14) (2025-05-23)
410
[Full Changelog](https://github.com/prey/prey-node-client/compare/v1.13.13..v1.13.14)
511

lib/agent/actions/logretrieval/index.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,28 @@ exports.collectFiles = (outputFile, cb) => {
8282
return;
8383
}
8484
array.push((callback) => {
85-
let fileData;
85+
let fileData = '';
8686
const rs = fs.createReadStream(file.path);
8787
rs.on('error', () => {
8888
callback();
8989
});
9090

9191
rs.on('data', (data) => {
92-
if (fileData) fileData = fileData.toString().concat(data);
93-
else fileData = data;
92+
try {
93+
if (!data) logger.info(`There was an error reading file ${file.name}: no data`);
94+
if (fileData) fileData = fileData.toString().concat(data);
95+
else fileData = data;
96+
} catch (error) {
97+
logger.info(`There was an error reading file ${file.name}: ${error}`);
98+
}
9499
});
95100

96101
rs.on('close', () => {
97-
archive.append(fileData, { name: file.name });
102+
try {
103+
archive.append(fileData || '', { name: file.name });
104+
} catch (error) {
105+
logger.info(`There was an error appending file ${file.name} to archive: ${error}`);
106+
}
98107
callback();
99108
});
100109
});

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "prey",
3-
"version": "1.13.14",
3+
"version": "1.13.15",
44
"author": "Engineering <[email protected]>",
55
"keywords": [
66
"prey",

0 commit comments

Comments
 (0)