sebastian-lenz / craft-linkfield

Link field for Craft 3
MIT License
122 stars 65 forks source link

Impossible to invoke a method ("getLink") on a null variable. #238

Closed mark-chief closed 1 year ago

mark-chief commented 2 years ago

In craft 4, I am getting this error when using the below code.

Impossible to invoke a method ("getLink") on a null variable.

{{ block.cta.getLink({
  class: 'cta cta-light',
 }) }}

The field is in a Matrix > Supertable >Matrix structure.

{{ block.cta }} outputs the URL ok.

Thanks