From db990aa3c55e9eb79455285d7d0d326974c970e3 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 22:28:18 -0500 Subject: Fixes #4093 making sure elgg.page_owner is defined --- js/lib/pageowner.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'js/lib') diff --git a/js/lib/pageowner.js b/js/lib/pageowner.js index 825898416..c695c41c3 100644 --- a/js/lib/pageowner.js +++ b/js/lib/pageowner.js @@ -6,9 +6,13 @@ */ /** - * @return {number} The GUID of the logged in user + * @return {number} The GUID of the page owner entity or 0 for no owner */ elgg.get_page_owner_guid = function() { - return elgg.page_owner.guid || 0; + if (elgg.page_owner !== undefined) { + return elgg.page_owner.guid; + } else { + return 0; + } }; -- cgit v1.2.3