Skip to content

RunHandler is null #462

@Martmists-GH

Description

@Martmists-GH
tasks {
    val deploy by registering {
        doLast {
            ssh.run(closureOf<RunHandler> {
                session(devServer, closureOf<SessionHandler> {
                    put(hashMapOf(
                        "from" to outputJar.single(),
                        "into" to prop("sshDeployPath")
                    ))
                })
            })
        }
    }
}

gives error

> Parameter specified as non-null is null: method Build_gradle$5$deploy$2$1.execute$lambda$0, parameter $this$closureOf

When changed to:

tasks {
    val deploy by registering {
        doLast {
            ssh.run(closureOf<RunHandler?> {
                println("RunHandler: $this")
                // ...

it logs:

RunHandler: null

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions