[NUI] Check null before call dispose