Skip to content

Commit

Permalink
修复 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
keepactive committed Dec 27, 2020
1 parent 46af369 commit 286ba2e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,11 @@ public static Throwable getRealThrowable(@NonNull Throwable throwable) {
* 是否是由于某一个错误引起的
*/
public static boolean isCauseBy(@NonNull Throwable throwable, @NonNull Class<? extends Throwable> clazz) {
Utils.checkNullPointer(throwable);
if (throwable.getClass() == clazz) {
return true;
}
while (throwable.getClass() != null) {
while (throwable.getCause() != null) {
throwable = throwable.getCause();
if (throwable.getClass() == clazz) {
return true;
Expand Down

0 comments on commit 286ba2e

Please sign in to comment.