Fix variable access from an empty environment state

This fixes a crash in playback code when attempting to search for an environment variable in an empty environment state.