fix #1897: null check mBucket onResume/onPause

fix #1897: null check mBucket onResume/onPause