Add a null check for actions