I think it may be a side effect of the else part of the statement that can end up returning NULL.