The automask cache is not guaranteed to exist for a given tool type, instead of forcing developers to remember to guard the dereference with a null check, this commit adds an inline overload that performs the check for the user on a raw pointer. The API takes in pointers instead of smart pointers as this method is not intended to take ownership of the pointer into consideration. Pull Request: https://projects.blender.org/blender/blender/pulls/126346