diff --git a/sites/all/modules/frontpage/frontpage.module b/sites/all/modules/frontpage/frontpage.module
index 5588ebd..61df621 100644
--- a/sites/all/modules/frontpage/frontpage.module
+++ b/sites/all/modules/frontpage/frontpage.module
@@ -402,9 +402,12 @@ function template_preprocess_frontpage(&$variables) {
  *   When it is not FALSE, the function will redirect the user.
  */
 function frontpage_set($node, $type, $goto = FALSE) {
-  $frontpage = is_array($node) ? $node[0] : $node;
+
+  $node = is_array($node) ? array_shift($node) : $node;
+  $frontpage_nid = is_numeric($node) ? $node : $node->nid;
+
   $vars = new FrontpageVars();
-  $vars["frontpage_{$type}_node"] = $frontpage->nid;
+  $vars["frontpage_{$type}_node"] = $frontpage_nid;
 
   if ($goto) {
     drupal_goto('', array('query' => drupal_get_destination()));
