java.lang.NullPointerException: cannot unbox null value装箱拆箱引发的空指针异常

 

 

 

 解决思路:首先根据报错定位到关键的一句话

list<charginPileVO>......

 

然后断点,并且将这句话 add to watch 会出现真正的异常:java.lang.NullPointerException: cannot unbox null value
是因为拆箱的时候对象为空,所以拆箱报错,integer对象到int基本类型会自动拆箱。而integer为空,所以报错。

 

posted @ 2021-12-24 15:54  石三爷  阅读(1546)  评论(0编辑  收藏  举报