NullPointerException Spring HATEOAS


I’tm trying to add a simple HATEOAS link, using Spring HATEOAS, in my Kotlin application. But for some reason I’m getting NullPointerException and I really don’t know why.

This is the method that add a link:

Controller method:

I really don’t understand what’s wrong. Is it a Spring Hateoas bug?


I figure it out. The error happens because my method is closed too. So I have to open it.