我使用x!=null以避免NullPointerException。还有其他选择吗?