static function getConfigData(Profile $profile, $namespace, $topic) {
try {
$data = self::getData($profile, $namespace, $topic);
- } catch (Exception $e) {
+ } catch (NoResultException $e) {
$data = common_config($namespace, $topic);
}
return $data;
$pref->topic = $topic;
$pref->data = $data;
- if (!$pref->insert()) {
+ if ($pref->insert() === false) {
throw new ServerException('Could not save profile preference.');
}
return true;