Return 0 from sum if result is null.