13e9f553b9
Instead of using pointers for these functions, they should be using references (in most cases) and let the caller make sure that the layer actually exists.