Enable api_v3_syntaxConformaceTest::testInvalidID_delete (#9068)
[civicrm-core.git] / CRM / Core / BAO / Dashboard.php
index ccc82d105c5fd80320df00a4fd5592079b80184d..d64620e3f66e81adb472e6432a7c86e6390d7ad8 100644 (file)
@@ -493,6 +493,9 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
   public static function deleteDashlet($dashletID) {
     $dashlet = new CRM_Core_DAO_Dashboard();
     $dashlet->id = $dashletID;
+    if (!$dashlet->find(TRUE)) {
+      return FALSE;
+    }
     $dashlet->delete();
     return TRUE;
   }