Avoid deprecation in checking for valid list.