0%

空指针 println needs a message

空指针异常:

1
2
3
4
5
6
7
8
java.lang.NullPointerException: println needs a message
at android.util.Log.println_native(Native Method)
at android.util.Log.e(Log.java:232)
at com.lphtsccft.zhangle.foundation.utility.t.a(SourceFile:227)
at com.lphtsccft.zhangle.foundation.utility.t.c(SourceFile:462)
at com.lphtsccft.zhangle.foundation.utility.t.b(SourceFile:409)
at com.lphtsccft.zhangle.foundation.utility.t.a(SourceFile:26)
at com.lphtsccft.zhangle.foundation.utility.t$a.onServiceConnected(SourceFile:345)

注意打印Log时,不能使用如下方式,message有可能为 null

1
2
3
4
try {
} catch (Exception e) {
Log.e(TAG, e.getMessage());
}