Spring with Querydsl : Null Pointer Exception

后端 未结 1 1603
孤独总比滥情好
孤独总比滥情好 2021-01-27 23:52

I am trying to implement Search filter functionality and load grid in spring boot data JPA application. For creating dynamic query I am using Querydsl.

相关标签:
1条回答
  • 2021-01-27 23:58

    I think the issue is if (nBuildId != 0). nBuildId is a big Integer so when the check is being performed it is being unboxed to a primitive int. If it's null, this will cause a NullPointerException. A null check on nBuildId should fix things, E.G. if (nBuildId != null && nBuildId != 0).

    0 讨论(0)
提交回复
热议问题