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.
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.