Skip to content

Commit 75cbd00

Browse files
committed
fix(resetserver): accessing of possible undefined
1 parent 181744b commit 75cbd00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/commands/Administration/resetserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const Resetserver: Command<Message> = {
101101
.map(
102102
(save) => `${client.config.serverpath}/${server.path}/saves/${save}`
103103
);
104-
const latestSavePath = sortModifiedDate(saves)[0].path;
104+
const latestSavePath = sortModifiedDate(saves)[0]?.path;
105105
// if there are saves, back up latest and remove all after
106106
if (latestSavePath) {
107107
const latestSave = latestSavePath.slice(

0 commit comments

Comments
 (0)