SonarQube Blocker Issue NullPointerException might be thrown as 'contacts' is nullable here
<p>I have a method that returns list of contacts. When I am running this code on SonarQube server. It shows a blocker issue stating <strong>NullPointerException might be thrown as 'contacts' is nullable here.</strong>. How to resolve this?</p>

<pre><code>    List&lt;Contact&gt; getContactDetails(){...}

    public void checkSize() {
      List&lt;Contact&gt; contacts = getContactDetails(); 
      syso(contacts.size()); 
    }
</code></pre>