Unless there is a normal case where this can be called with `rootHandler=None` I'd make this an assertion at the beginning and use `rootHandler.get`:

```
assert(serverInfo.isDefined, "Tried to attach SparkUI to master that wasn't initialized")
```
or something...