Skip to content

Commit

Permalink
AB#31023: Fix createDbDump error when no dumps folder present
Browse files Browse the repository at this point in the history
  • Loading branch information
e-halinen committed Feb 12, 2024
1 parent cbf3e3b commit f952d3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/createDbDump.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const dumpsDir = path.join(cwd, "dumps");

export const deleteFiles = ({ filesDir, minFileCount }) => {
fs.readdir(filesDir, (err, files) => {
if (files.length < minFileCount) return;
if (!files || files.length < minFileCount) return;
files.forEach((file) => {
const removableFile = path.join(filesDir, file);
fs.stat(removableFile, async (err, stat) => {
Expand Down

0 comments on commit f952d3a

Please sign in to comment.