I need help using an if statement that should only be run if the test is false in a for-comprehension dealing with futures. I am new to scala and using [this blog post](https://danielwestheide.com/blog/2013/01/09/the-neophytes-guide-to-scala-part-8-welcome-to-the-future.html) as my guide.

The code is

```
  for {
      emptyResults: Boolean = areResultsEmpty(content)
      resp <- getResp(content) if !emptyResults
      } yield resp

```

If `emptyResults` is true then the `getResp()` throws an error, but in the above, `getResp()` gets run even when `emptyResults` is true. How do I make sure that the `getResp()` only gets run if `emptyResults` is false?

I have also tried writing the if statement like below but that throws an error `error: value map is not a member of Any`

```
  acmResp <- if (!emptyResults) {
    getResp(content)
  }

```

I have looked over other solutions here including [this](https://stackoverflow.com/questions/7949785/scalas-for-comprehension-if-statements) and [this](https://stackoverflow.com/questions/7949785/scalas-for-comprehension-if-statements) and [this](https://stackoverflow.com/questions/4192227/how-can-i-do-if-else-inside-a-for-comprehension) but they haven't helped with this issue.