From c58228195b6e187c5370d3929c623db89ac9ee23 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Fri, 26 Feb 2016 01:11:20 +0100 Subject: [PATCH] Make sure the saved Notice has an ID --- classes/Notice.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classes/Notice.php b/classes/Notice.php index 86eec8e3ad..892f2be30e 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -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 -- 2.39.5