aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/lib/pageowner.js8
1 files changed, 6 insertions, 2 deletions
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;
+ }
};