kwebio / kweb-core

A Kotlin web framework
https://docs.kweb.io/book
GNU Lesser General Public License v3.0
969 stars 57 forks source link

Modifying element id causing NPE #486

Closed sanity closed 1 year ago

sanity commented 1 year ago
    button { button ->
        button.id = "generate-keypair"
        button.text("Generate new keypair")
    }

Causes exception:

java.lang.NullPointerException
    at kweb.Element.text(Element.kt:426)
    at org.freenet.website.pages.claimId.ClaimIdPageKt$claimIdPage$1.invoke(claimIdPage.kt:12)
    at org.freenet.website.pages.claimId.ClaimIdPageKt$claimIdPage$1.invoke(claimIdPage.kt:10)
    at kweb.PreludeKt.button(prelude.kt:85)
    at kweb.PreludeKt.button$default(prelude.kt:72)
    at org.freenet.website.pages.claimId.ClaimIdPageKt.claimIdPage(claimIdPage.kt:10)
    at org.freenet.website.pages.RenderPageKt$pages$5.invoke(renderPage.kt:27)
    at org.freenet.website.pages.RenderPageKt$pages$5.invoke(renderPage.kt:27)
    at org.freenet.website.pages.RenderPageKt$renderNavBarAndPage$2.invoke(renderPage.kt:58)
    at org.freenet.website.pages.RenderPageKt$renderNavBarAndPage$2.invoke(renderPage.kt:56)
    at kweb.state.RenderKt.render$eraseAndRender(render.kt:64)
    at kweb.state.RenderKt.access$render$eraseAndRender(render.kt:1)
    at kweb.state.RenderKt$render$renderLoop$1.invoke(render.kt:81)
github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.