title: How to check if an attribute is present in Gatling/Scala
body: <p>I would think this is probably easy to do, but I really don't know Scala at all.</p>
  
  <p>I have a scenario where a first time user will log in and see a page, then if they log in again they won't see this page. So the best I've come up with so far is this:</p>
  
  <pre><code>val chain = exec(
  http("Login page")
    .get("/en/login")
    .headers(Config.HTML_HEADER)
  ).exec(
        http("login request")
          .post("/en/j_spring_security_check")
          .formParam("j_username", """${username}""")
          .formParam("j_password", """${password}""")
          .check(status.is(200))
          .check(currentLocationRegex(".*termsAndConditions").optional.saveAs("tc"))
      )
      .doIf(session =&gt; !session("tc").equals(null)) { // this doesn't work 
        exec(AgreeTermsAndConditions.chain)
    }
  </code></pre>
  
  <p>So I've tried a bunch of things on the doIf, the goal is just do if session "tc" is not set. Is there an easy way to do that?</p>