Make sure the saved Notice has an ID

This commit is contained in:
Mikael Nordfeldth 2016-02-26 01:11:20 +01:00
parent 519e3308ab
commit c58228195b
1 changed files with 3 additions and 1 deletions

View File

@ -997,7 +997,9 @@ class Notice extends Managed_DataObject
}
}
if (!$stored instanceof Notice) {
throw new ServerException('StartNoticeSave did not give back a Notice');
throw new ServerException('StartNoticeSave did not give back a Notice.');
} elseif (empty($stored->id)) {
throw new ServerException('Supposedly saved Notice has no ID.');
}
// Only save 'attention' and metadata stuff (URLs, tags...) stuff if