소스 검색

[Fix]ActivityUtil空栈异常

zhipeng 2 년 전
부모
커밋
feb0cc2376
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      common/src/main/java/com/atmob/common/runtime/ActivityUtil.java

+ 3 - 0
common/src/main/java/com/atmob/common/runtime/ActivityUtil.java

@@ -75,6 +75,9 @@ public class ActivityUtil {
     }
 
     public static Activity getTopActivity() {
+        if (getActivityCount() == 0) {
+            return null;
+        }
         return Holder.INSTANCE.activityStack.peek();
     }