debug---null Pointer Exception--一步步查找

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了debug---null Pointer Exception--一步步查找相关的知识,希望对你有一定的参考价值。

添加PartyLocationRepository后,再次在Ubuntu中编译项目,再次报空指针异常。

技术分享

直接在createDto处打断点,然后debug每个表达式的值,找出来到底是哪个为null。

技术分享

经过分析,发现是this.getConverter()为null,而这个Converter是和PartyLocationEntity以及PartyLocationDto对应的。因此,这里还需要写个PartyLocationEntity和PartyLocationDto关联的PartyLocationConver类。

以上是关于debug---null Pointer Exception--一步步查找的主要内容,如果未能解决你的问题,请参考以下文章

我可以使用 if (pointer) 而不是 if (pointer != NULL) 吗?

NULL Pointer Dereference(转)

Application + Activity + onResume == NULL POINTER EXCEPTION

ListView.setAdapter Null Pointer exception 虽然 adapter.getCount 显示所有记录并且 Listview 也不是 Null [重复]

C语言常见问题:Called function pointer is null (null dereference)

C语言常见问题:Called function pointer is null (null dereference)