Skip to content

Commit

Permalink
Added a check to make sure that a doi_node exists and was found befor…
Browse files Browse the repository at this point in the history
…e attempting to display the node
  • Loading branch information
mdye committed Jan 9, 2017
1 parent 5fa53f7 commit 7240697
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion doi_display.module
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ function _get_referenced_doi_node($nid) {
array_push($doi_nids, $nid->entity_id);
}

$doi_node = node_load($doi_nids[0]);
$doi_node = null;

if (isset($doi_nids[0]) && $doi_nids[0]) {
$doi_node = node_load($doi_nids[0]);
}

return($doi_node);
}
Expand Down

0 comments on commit 7240697

Please sign in to comment.