Skip to content

Commit

Permalink
Issue #2304461 by sun: Fixed DependencySerializationTrait breaks sans…
Browse files Browse the repository at this point in the history
… container.
  • Loading branch information
sun committed Aug 1, 2014
1 parent 2004790 commit 3c0635a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ public function __sleep() {
* {@inheritdoc}
*/
public function __wakeup() {
$container = \Drupal::getContainer();
foreach ($this->_serviceIds as $key => $service_id) {
$this->$key = $container->get($service_id);
if ($container = \Drupal::getContainer()) {
foreach ($this->_serviceIds as $key => $service_id) {
$this->$key = $container->get($service_id);
}
}
$this->_serviceIds = array();
}
Expand Down

0 comments on commit 3c0635a

Please sign in to comment.