# Report false positive NPE

**URL:** <https://community.sonarsource.com/t/report-false-positive-npe/92347>\
**Category:** SonarQube Cloud\
**Tags:** java\
**Created:** [June 12, 2023, 8:29am UTC](https://community.sonarsource.com/t/report-false-positive-npe/92347 "2023-06-12T08:29:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cyrille\_Mortier](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/cyrille_mortier/32/46025_2.png) [@Cyrille\_Mortier](https://community.sonarsource.com/u/Cyrille_Mortier)\
**Post date:** [June 12, 2023, 8:29am UTC](https://community.sonarsource.com/t/report-false-positive-npe/92347/1 "2023-06-12T08:29:50Z")

</div>

Hello using Sonarcloud,

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/a/6/a6cf4932e597f99bb523397290d08d68a3e40c50.png)  
How can we handle this ?

---

<div class="post-metadata">

**Author:** ![Quentin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/quentin/32/74716_2.png) [@Quentin](https://community.sonarsource.com/u/Quentin)\
**Post date:** [June 12, 2023, 3:14pm UTC](https://community.sonarsource.com/t/report-false-positive-npe/92347/2 "2023-06-12T15:14:04Z")

</div>

Hello @Cyrille_Mortier and welcome to the Sonar Community.

I invite you to have a look at this post, answering a similar issue:

> [@\[False Positive\]A "NullPointerException" could be thrown;](https://community.sonarsource.com/t/false-positive-a-nullpointerexception-could-be-thrown/47025/3):
>
> Hello @Bhuvana The analyzer assumes that two consecutive method calls do not necessarily return the same value. It means that a null check on the first call to getBody() is not enough to avoid a NPE. You should extract the method call into a variable to not have an issue. In a way, this is a limitation of the analyzer, it is not able to detect if a method always returns the same value or not, so it reports an issue anyway, taking the risk to report false positives. If you are confident your c…

I hope it clarifies the situation.  
Best,  
Quentin
