1 parent 584ffc7 commit 33408b2Copy full SHA for 33408b2
1 file changed
oit.module
@@ -89,6 +89,10 @@ function oit_form_alter(&$form, FormStateInterface $form_state, $form_id) {
89
if (array_key_exists('#webform_id', $form)) {
90
// Get node id current webform is on.
91
$node = \Drupal::routeMatch()->getParameter('node');
92
+ if ($node == NULL) {
93
+ return;
94
+ }
95
+
96
$node_id = is_string($node) ? 0 : $node->id();
97
$current_user = \Drupal::currentUser();
98
$roles = $current_user->getRoles();
0 commit comments