From 28f37109b8a6fc263c24308c6c7f4a37b5cb3d14 Mon Sep 17 00:00:00 2001 From: Herb Date: Mon, 1 Jan 2024 16:20:29 -0500 Subject: [PATCH] Issue #19 check that node type exists --- references_dialog.dialog_widgets.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/references_dialog.dialog_widgets.inc b/references_dialog.dialog_widgets.inc index 02efc48..9c4e709 100644 --- a/references_dialog.dialog_widgets.inc +++ b/references_dialog.dialog_widgets.inc @@ -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('_' => '-')),