title: Best Practices for nested Scala Option fields?
body: <p>I've got a number of nested objects, all wrapped in a Scala Option type. Elsewhere in my project I'm having to call an attribute that is embedded some 5 levels deep (some of which are Lists), each time making a call to <code>.get</code>. This way I end up with something that looks like the following:</p>
  
  <pre><code>objectA.get.attrB.get.attrC.get(0).attrD.get
  </code></pre>
  
  <p>Other than the series of <code>.get</code> calls (which I'm not sure is ideal), I'm not implementing much error handling this way and should any of the attributes be empty then the whole thing falls apart. Given the nested calls, if I were to limit this to a one-liner as above, I would also only be able to use <code>.getOrElse</code> once at the end.</p>
  
  <p>Are there any suggested ways of working with Option types in Scala?</p>