Null check before stopping selenium