From 10f030de677b6f815b000bc9f53e0e4221b47ec6 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 27 Mar 2012 09:54:47 +1300 Subject: [PATCH] BUGFIX When adding a top level folder in AssetAdmin, ensure you are taken back to the top level folder view. Currently there is a non-object error adding a root level folder. --- code/controllers/AssetAdmin.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/controllers/AssetAdmin.php b/code/controllers/AssetAdmin.php index f7f6f6c3..2596e5cb 100644 --- a/code/controllers/AssetAdmin.php +++ b/code/controllers/AssetAdmin.php @@ -407,7 +407,11 @@ JS mkdir($record->FullPath); chmod($record->FullPath, Filesystem::$file_create_mask); - return $this->redirect(Controller::join_links($this->Link('show'), $parentRecord->ID)); + if($parentRecord) { + return $this->redirect(Controller::join_links($this->Link('show'), $parentRecord->ID)); + } else { + return $this->redirect($this->Link()); + } } /**