Skip to content

Commit

Permalink
Issue #19 check that node type exists
Browse files Browse the repository at this point in the history
  • Loading branch information
herbdool authored Jan 1, 2024
1 parent aaa32f1 commit 28f3710
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion references_dialog.dialog_widgets.inc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function references_dialog_node_reference_add_link($element, $widget_settings, $
foreach ($field['settings']['referenceable_types'] as $type => $active) {
if ($active !== 0) {
$node_type = node_type_load($type);
if (node_access('create', $node_type->type)) {
if ($node_type && node_access('create', $node_type->type)) {
$add_links[] = array(
'title' => t('Create @type', array('@type' => $node_type->name)),
'href' => 'node/add/' . strtr($type, array('_' => '-')),
Expand Down

0 comments on commit 28f3710

Please sign in to comment.