Commit 652e211e authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

[gh-481] Handle the case where the parent site's 404 node isn't found

parent 0e961862
......@@ -452,10 +452,15 @@ function unl_404_page() {
$default_404 = unl_shared_variable_get('site_404');
// @TODO: $default_404 should look like "node/182" but is there a safer way to retrieve nid?
$node = node_load(substr($default_404, 5));
drupal_set_title($node->title);
$build = node_view($node, 'full');
$build['links']['#access'] = FALSE;
$build['#contextual_links'] = NULL;
if ($node) {
drupal_set_title($node->title);
$build = node_view($node, 'full');
$build['links']['#access'] = FALSE;
$build['#contextual_links'] = NULL;
}
else {
$build = array();
}
// Restore database connection.
db_set_active();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment