Delete only if exists
This commit is contained in:
parent
bc5c04c7be
commit
9cb34839ec
@ -593,7 +593,7 @@ class User implements JsonSerializable
|
|||||||
|
|
||||||
// Delete old picture if it isn't a default one and if it exists.
|
// Delete old picture if it isn't a default one and if it exists.
|
||||||
try {
|
try {
|
||||||
if (strpos($oldImage, "default") === false) unlink(Config::getStorageFSPath() . $oldImage);
|
if (strpos($oldImage, "default") === false && file_exists(Config::getStorageFSPath() . $this->image)) unlink(Config::getStorageFSPath() . $oldImage);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -624,7 +624,7 @@ class User implements JsonSerializable
|
|||||||
|
|
||||||
// Delete picture if it isn't a default one and if it exists.
|
// Delete picture if it isn't a default one and if it exists.
|
||||||
try {
|
try {
|
||||||
if (strpos($this->image, "default") === false) unlink(Config::getStorageFSPath() . $this->image);
|
if (strpos($this->image, "default") === false && file_exists(Config::getStorageFSPath() . $this->image)) unlink(Config::getStorageFSPath() . $this->image);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user