doIf on unequality

Hello out there!

been trying to get following to work (2.0.0-M3a), wouldn’t compile…:

.doIf(session => session(“webServiceError”) != “null”)
{
exec((session: Session) => { // Application error → print session debug data
println(session)
session
})
}

My workaround as below is using doIfEqualsOrElse instead, it works, but isn’t it really possible to use doIf?

.doIfEqualsOrElse("${webServiceError}", “null”)
{
pause(1) // No error → do nothing
}{
exec((session: Session) => { // Application error → print session data
println(session)
session
})
}

/rgds Juha

This compiles in snapshot, but condition would always be false.
session(“webServiceError”) is of type SessionAttribute, and there’s no way it equals a String.

assuming webServiceError does exists and is a String:

session(“webServiceError”).as[String] != “null”

Wow - that was fast :slight_smile: Just verified your correction, works just fine.
Thanks Stéphane - you are the man!