Should be a space after `if`, and use braces on that block. Might be better to rewrite with early return, e.g.

```{r}
if (!identical(x$geom$objname, geom)) return(x)
x$geom_params <- modifyList(x$geom_params, args)
```

(note that `identical()` is safer here because it's not vectorised)