check whether swipeLayout is null before trying to deal with it