Skip to content

Commit e5d7786

Browse files
author
jianwuch
committed
处理空指针
1 parent 96ccc48 commit e5d7786

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

starskylib/src/main/java/com/jove/starskylib/StarSkyView.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,12 @@ public void run() {
243243
@Override
244244
protected void onDetachedFromWindow() {
245245
super.onDetachedFromWindow();
246-
mHandler.removeCallbacksAndMessages(null);
247-
mFarStarAnimator.removeAllUpdateListeners();
246+
if (mHandler != null) {
247+
mHandler.removeCallbacksAndMessages(null);
248+
}
249+
250+
if (mFarStarAnimator != null) {
251+
mFarStarAnimator.removeAllUpdateListeners();
252+
}
248253
}
249254
}

0 commit comments

Comments
 (0)