Why return null here instead of throwing an exception that explains the problem? It's going to create a NullPointerException later on, which will be confusing.