Made getState() throw if state is null