Skip to content

Commit e2d1dd4

Browse files
committed
Check if file exists before trying to delete it.
1 parent 10617e2 commit e2d1dd4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/FileLock.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ public function release()
9797
}
9898

9999
if ($this->remove_on_release && $this->flock(LOCK_EX | LOCK_NB)) {
100-
unlink($this->lock_file);
100+
if (is_file($this->lock_file)) {
101+
unlink($this->lock_file);
102+
}
101103
}
102104

103105
$this->flock(LOCK_UN);

0 commit comments

Comments
 (0)