Fix potential null pointer access in StateVariablesTest
reformat