(Comment applies to line below, but am putting it here for clarity)

If you write:
```js
if (!goog.isDef(layerObject)) {
  return undefined;
}
```
You can then un-indent the block below and ensure that the function always explicitly returns a value.