title: How do I correct bad arguments to a Scala constructor?
body: <p>I have a Scala class as shown:</p>
  
  <pre><code>class MyClass(title: String, value: Int) {
     ...
  }
  </code></pre>
  
  <p>If the constructor is called with a <code>title</code> value of <code>null</code>, I would like to set <code>title</code> to the empty string instead. How can I do that? Is there a cleaner way than forcing <code>title</code> to be private and providing a getter?</p>
  
  <pre><code>def getTitle: String = if (title == null) "" else title
  </code></pre>