LPS-51401 Throw an IllegalArguementException instead of allowing the NullPointerException possibility
LPS-51401 Only perform the null check if it's necessary