mirror of
https://git.bits.team/Bits/mod-manager.git
synced 2024-12-22 04:18:21 -05:00
Protect against log file being null or undefined
This commit is contained in:
parent
935262ec0f
commit
9c3824e81d
@ -61,7 +61,7 @@ export default class ModManager {
|
||||
// If no errors are logged, cleanup the log file when the process exits
|
||||
process.on("exit", () => {
|
||||
// If file is only whitespace, i.e. blank
|
||||
if (!readFileSync(this.LOG_FILE, "utf-8").trim().length) {
|
||||
if (!readFileSync(this.LOG_FILE, "utf-8")?.trim().length) {
|
||||
unlinkSync(this.LOG_FILE)
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user