Skip to content

Commit

Permalink
Avoid notices on null columns.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Feb 26, 2014
1 parent 00c3f96 commit 35fdeb0
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions kronolith/lib/Event/Sql.php
Expand Up @@ -129,10 +129,16 @@ public function fromDriver($SQLEvent)
$this->status = (int)$SQLEvent['event_status'];
}
if (isset($SQLEvent['event_attendees'])) {
$this->attendees = array_change_key_case($driver->convertFromDriver(unserialize($SQLEvent['event_attendees'])));
$attendees = unserialize($SQLEvent['event_attendees']);
if ($attendees) {
$this->attendees = array_change_key_case($driver->convertFromDriver($attendees));
}
}
if (isset($SQLEvent['event_resources'])) {
$this->_resources = array_change_key_case($driver->convertFromDriver(unserialize($SQLEvent['event_resources'])));
$resources = unserialize($SQLEvent['event_resources']);
if ($resources) {
$this->_resources = array_change_key_case($driver->convertFromDriver($resources));
}
}
if (isset($SQLEvent['event_description'])) {
$this->description = $driver->convertFromDriver($SQLEvent['event_description']);
Expand All @@ -141,7 +147,10 @@ public function fromDriver($SQLEvent)
$this->alarm = (int)$SQLEvent['event_alarm'];
}
if (isset($SQLEvent['event_alarm_methods'])) {
$this->methods = $driver->convertFromDriver(unserialize($SQLEvent['event_alarm_methods']));
$methods = unserialize($SQLEvent['event_alarm_methods']);
if ($methods) {
$this->methods = $driver->convertFromDriver($methods);
}
}
if (isset($SQLEvent['event_baseid'])) {
$this->baseid = $SQLEvent['event_baseid'];
Expand Down

0 comments on commit 35fdeb0

Please sign in to comment.