title: Do I need to check for null in Loan Pattern
body: <p>Here is a common example of loan pattern:</p>
  
  <pre><code>def using[A &lt;: {def close() : Unit}, B](param: A)(f: A =&gt; B): B =
     try {
         f(param)
     } finally {
         param.close()
     }
  </code></pre>
  
  <p>Do I need to take care of NPE and add check? </p>
  
  <pre><code>def using[A &lt;: {def close() : Unit}, B](param: A)(f: A =&gt; B): B =
     try {
         f(param)
     } finally {
          if (param != null) param.close()
     }
  </code></pre>