title: Kotlin & Databinding Int value null check issue
body: <h3>This is the weirdest problem I faced ever.</h3>
  
  <p>So again kotlin &amp; data binding made me stuck. I start my question with the code.</p>
  
  <p><strong>Model class</strong></p>
  
  <pre><code>data class ModelBottomItem(
          @StringRes val name: Int,
          @DrawableRes val image: Int,
          val gender: Int = 0,
          val enabled: Boolean = true,
          val disabledIconColor: Int = 0)
      : BaseModel()
  </code></pre>
  
  <p><strong>Layout code</strong></p>
  
  <pre><code>&lt;variable
      name="item"
      type="myModel"/&gt;
  
  
  &lt;TextView
      android:text="@{item.gender == 0 ? @string/male : @string/female}"
      ...
      /&gt;
  </code></pre>
  
  <p><strong>Debug trace list</strong></p>
  
  <pre><code>0 = {ModelBottomItem@6406} "ModelBottomItem(name=2131755043, image=2131230862, gender=0, enabled=true, disabledIconColor=0)"
  </code></pre>
  
  <blockquote>
  <pre><code>08-10 12:57:12.388 24902-24902/acr.browser.barebones E/AndroidRuntime: FATAL EXCEPTION: main
      Process: acr.browser.barebones, PID: 24902
      java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
  </code></pre>
    
    <p>blah, blah !!</p>
  </blockquote>
  
  <h3>If i change <code>item.gender == null</code></h3>
  
  <p></p>
  
  <h3>Then the code is not able to build. It fails with below error.</h3>
  
  <blockquote>
  <pre><code>error: incomparable types: int and &lt;null&gt;
                  itemGenderJavaLangObjectNull = (itemGender) == (null);
  </code></pre>
  </blockquote>
  
  <h2>Understand problem in two lines.</h2>
  
  <ul>
  <li>When I check <strong><code>item.gender == null</code></strong> shows error <code>incomparable types: int and &lt;null&gt;</code>.</li>
  <li>And when I check for <strong><code>item.gender == 0</code></strong>, then code will crash saying <strong><code>int java.lang.Integer.intValue()' on a null object reference</code></strong> in case of 0 at run time. Even you can see debug trace, my model item is 0, it is not <code>**null**</code>. Even I have setted default value to gender, that is <strong><code>val gender: Int = 0</code></strong>. <strong>Then how can it be null or 0?</strong> </li>
  </ul>