title: Typescript object is possibly undefined
body: <pre><code>interface c {
      state?: {b: string}
  }
  
  const x: c = { state: {b: 'c'}}
  console.log(x.state.b)
  </code></pre>
  
  <p>In the above code, In interface c, state is an optional property.</p>
  
  <p>However when I want to access the property b of the state object whenever it is set, it is giving me this error, Object is possibly 'undefined'. What is the right way to fix this?</p>