In my rails contoller I have this code:

```
    if Photo.find(params[:photo_id]).patient_id == nil 
     .........
    else
     .........

```

So at the time I get a error when there are no `params[:photo_id]`:

```
    Couldn't find Photo without an ID

```

I know that I could fix it with: For example:

```
    if(params[:photo_id]) && (Photo.find(params[:photo_id]).patient_id == nil)

```

But now I tried to write an exception "how its called I think":

```
if Photo.find(params[:photo_id]).patient_id == nil rescue false

```

That throws a new error:

```
syntax error, unexpected modifier_rescue, expecting keyword_then or ';' or '\n' if 

```

So what did a wrong?(I'm beginner in programming!)