From f583d89b52b10e981ecf6c1e97c2cdcb83cb0cd7 Mon Sep 17 00:00:00 2001
From: Tim Otten <totten@civicrm.org>
Date: Wed, 15 Jan 2014 15:58:24 -0800
Subject: [PATCH] CRM-13889 - CRM_Core_BAO_Dashboard - Fix test failure. Report
 error better.

Note: It looks like there was a merge error because some of the relevant
code was badly duplicated.
---
 CRM/Core/BAO/Dashboard.php | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/CRM/Core/BAO/Dashboard.php b/CRM/Core/BAO/Dashboard.php
index 3e6f4b11c8..62e71391ba 100644
--- a/CRM/Core/BAO/Dashboard.php
+++ b/CRM/Core/BAO/Dashboard.php
@@ -308,8 +308,9 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
       $contactID = $session->get('userID');
     }
 
-    $session = CRM_Core_Session::singleton();
-    $contactID = $session->get('userID');
+    if (empty($contactID)) {
+      throw new RuntimeException("Failed to determine contact ID");
+    }
 
     //we need to get existing dashletes, so we know when to update or insert
     $contactDashlets = self::getContactDashlets(TRUE, $contactID);
-- 
GitLab