Original Post
Let's say I have a method like GetShader() or GetObject() which return pointers to types Shader and Object. If I were to pass an ID into the method, but the method can't find an object with the given ID, should I return NULL? Returning NULL is pretty much asking the program to crash since the rest of the program has no way of knowing whether or not the pointer returned is valid. Any suggesstions on how to handle such a situation elegantly?