Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Mooyman committed Apr 26, 2016
1 parent f617dd0 commit 7ca1e31
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions admin/code/AddToCampaignHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ protected function getObject($id, $class) {
'AddToCampaign.ErrorGeneral',
'We apologise, but there was an error'
));
return null;
}

$object = DataObject::get($class)->byID($id);
Expand All @@ -113,6 +114,7 @@ protected function getObject($id, $class) {
'',
['Type' => $class]
));
return null;
}

if (!$object->canView()) {
Expand All @@ -123,6 +125,7 @@ protected function getObject($id, $class) {
['ObjectTitle' => $object->Title]
)
);
return null;
}

return $object;
Expand Down Expand Up @@ -199,6 +202,7 @@ public function addToCampaign($object, $campaignID) {
'',
['Type' => 'Campaign']
));
return null;
}

if (!$changeSet->canEdit()) {
Expand All @@ -208,6 +212,7 @@ public function addToCampaign($object, $campaignID) {
'',
['ObjectTitle' => $object->Title, 'CampaignTitle' => $changeSet->Title]
));
return null;
}

$changeSet->addObject($object);
Expand Down

0 comments on commit 7ca1e31

Please sign in to comment.