Null pointer access: The variable "tipoEstablecimiento" can only be null at this location
<p>I've been searching in the Internet about this error with no result. I'm lost with it. Anyone can help with it?</p>

<pre><code>.
.
.

  TipoEstablecimientoHotel tipoEstablecimiento  = null;
.
.
.
.
try{
  tipoEstablecimiento.setCodigo("");  &lt;--- Line with the error.
}catch (Exception e){
  System.out.println(e.getMessage());
}
.
.
.
</code></pre>

<p>Of course I have the imports that I need (I mean for TipoEstablecimiento), and it marks that line with the corresponding warning.</p>

<p>Thanks in advance.</p>
