state null check