Yes, that's right. The check is only unnecessary if we want to throw an exception (since this will happen anyway). If we want to log an error and tolerate the null, then we need to check. What is the right thing here depends on the conditions under which this happens. Is it a problem that tends to happen from time to time due to some error in the dump? Then we should log an error and continue. Is it a problem that should never ever happen unless we have a programming error? Then we should fail hard and fast. One should also consider if it is maybe better to check this before calling this function (if this allows for a more informative logging or if the correct behaviour depends on the context in which the function is used).