Skip to content

Commit 33408b2

Browse files
committed
webform: bug fix null node
1 parent 584ffc7 commit 33408b2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎oit.module‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ function oit_form_alter(&$form, FormStateInterface $form_state, $form_id) {
8989
if (array_key_exists('#webform_id', $form)) {
9090
// Get node id current webform is on.
9191
$node = \Drupal::routeMatch()->getParameter('node');
92+
if ($node == NULL) {
93+
return;
94+
}
95+
9296
$node_id = is_string($node) ? 0 : $node->id();
9397
$current_user = \Drupal::currentUser();
9498
$roles = $current_user->getRoles();

0 commit comments

Comments
 (0)