switch case in protected scope 异常解决