Java - ignore exception and continue
<p>For my Java application, I am creating an instance of a user information object and populating it with a service that I don't control the source for. </p>

<p>The code looks like this:</p>

<pre><code>// username given as parameter
UserInfo ui = new UserInfo();
try {
    DirectoryUser du = LDAPService.findUser(username);
    if (du!=null) {
       ui.setUserInfo(du.getUserInfo());
    }
} catch (Exception e) {
    // Whatever
}
</code></pre>

<p>If <code>LDAPService.findUser()</code> can't locate a user, it will throw a <code>NullPointerException</code> and grind the rest of my application to a stop. It's okay if the user information isn't populated, so I want to be able to continue without causing everything else to start throwing exceptions.</p>

<p>Is there a way to do this?</p>
