More bugfixes
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Lauri Võsandi 2022-02-15 22:14:27 +02:00 committed by Lauri Võsandi
parent 05911bbc80
commit a08f1d37b7

View File

@ -45,10 +45,10 @@ async function run() {
});
function wrapEvent(doc) {
if (doc.screenshot_count) {
if (doc && doc.screenshot_count) {
doc.screenshots = [];
for (let i = 1; i <= doc.screenshot_count ; i++) {
minioClient.presignedUrl('GET', minioBucket, `${data.fullDocument.camera}/${data.fullDocument._id}/${i}.jpg`, 60 * 60, (err, presignedUrl) => {
minioClient.presignedUrl('GET', minioBucket, `${doc.camera}/${doc._id}/${i}.jpg`, 60 * 60, (err, presignedUrl) => {
if (err) { return console.log(err) };
doc.screenshots.push({ url: presignedUrl });
})