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:
Michael Andrewartha 2009-03-23 02:26:24 +00:00 committed by Sam Minnee
parent b4921db9d7
commit 07ef4d77f9

View File

@ -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")) {