prevent php notice when current_gen is not an array for array_key_exists

also applies for 1.9