Fixed potential runtime error:
member access on null object