title: 'if' must have both main and 'else' branches if used as an expression
body: <p>I have the code below working before, now compiler halts and marks both <code>if</code> statements and says:</p>
  <p><strong>'if' must have both main and 'else' branches if used as an expression</strong></p>
  <p>But as you see this is not an expression, but just a simple equality statement and a conditional statement next to it.</p>
  <pre><code>try {
      val json_string = responseBody!!.string()
      val jsonObject = JSONObject(json_string)
      if (jsonObject.has(&quot;version&quot;)) {
  
          val remoteVersion = jsonObject.getInt(&quot;version&quot;)
          if (remoteVersion &gt; BuildConfig.VERSION_CODE) {
              handler.post {
                  showInstallNewVersionDialog()
              }
          }
      }
  } catch (e: Exception) {
      e.message?.let { Log.e(Constants.TAG, e.message!!) }
  
  }
  </code></pre>
  <p>The funny part is if I added empty <code>else</code> tags, it will run but will warn to remove empty <code>else</code> statements:</p>
  <pre><code>if (jsonObject.has(&quot;version&quot;)) {
  
      val remoteVersion = jsonObject.getInt(&quot;version&quot;)
      if (remoteVersion &gt; BuildConfig.VERSION_CODE) {
          handler.post {
              showInstallNewVersionDialog()
          }
      } else {}
  } else {}
  </code></pre>