mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR check for existing file object
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@73529 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b4921db9d7
commit
07ef4d77f9
@ -431,7 +431,7 @@ class File extends DataObject {
|
||||
if($this->ParentID) {
|
||||
$p = DataObject::get_one('Folder', "ID={$this->ParentID}");
|
||||
|
||||
if($p->ID) return $p->getRelativePath() . $this->getField("Name");
|
||||
if($p && $p->ID) return $p->getRelativePath() . $this->getField("Name");
|
||||
else return ASSETS_DIR . "/" . $this->getField("Name");
|
||||
|
||||
} else if($this->getField("Name")) {
|
||||
|
Loading…
Reference in New Issue
Block a user