summaryrefslogtreecommitdiff
path: root/modules/organize
diff options
context:
space:
mode:
Diffstat (limited to 'modules/organize')
-rw-r--r--modules/organize/controllers/organize.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php
index 5a2c3e4f..048f6fc3 100644
--- a/modules/organize/controllers/organize.php
+++ b/modules/organize/controllers/organize.php
@@ -81,6 +81,9 @@ class Organize_Controller extends Controller {
foreach (explode(",", $input->post("source_ids")) as $source_id) {
$source = ORM::factory("item", $source_id);
+ if (!$source->loaded()) {
+ continue;
+ }
access::required("edit", $source->parent());
if ($source->contains($new_parent) || $source->id == $new_parent->id) {
@@ -116,6 +119,11 @@ class Organize_Controller extends Controller {
$input = Input::instance();
$target = ORM::factory("item", $input->post("target_id"));
+ if (!$target->loaded()) {
+ json::reply(null);
+ return;
+ }
+
$album = $target->parent();
access::required("edit", $album);