Make this function defensible against null/empty strings etc
<p>How can I make this function a little more 'defensible' against null/empty strings?</p>

<pre><code>function getSecondPart(str) {
    return str.split('-')[1];
}
</code></pre>
