Skip to content

Commit 4912314

Browse files
committed
Catch unhandled InvalidArgumentException
1 parent cf3e95b commit 4912314

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/controllers/User/Activate.php

+9-5
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
namespace BNETDocs\Controllers\User;
44

5-
use \BNETDocs\Models\User\Activate as UserActivateModel;
5+
use \CarlBennett\MVC\Libraries\Common;
6+
use \CarlBennett\MVC\Libraries\Controller;
7+
use \CarlBennett\MVC\Libraries\Router;
8+
use \CarlBennett\MVC\Libraries\View;
69

710
use \BNETDocs\Libraries\EventTypes;
811
use \BNETDocs\Libraries\Exceptions\UserNotFoundException;
912
use \BNETDocs\Libraries\Logger;
1013
use \BNETDocs\Libraries\User;
1114

12-
use \CarlBennett\MVC\Libraries\Common;
13-
use \CarlBennett\MVC\Libraries\Controller;
14-
use \CarlBennett\MVC\Libraries\Router;
15-
use \CarlBennett\MVC\Libraries\View;
15+
use \BNETDocs\Models\User\Activate as UserActivateModel;
16+
17+
use \InvalidArgumentException;
1618

1719
class Activate extends Controller {
1820

@@ -34,6 +36,8 @@ public function &run( Router &$router, View &$view, array &$args ) {
3436
$model->user = new User( $model->user_id );
3537
} catch ( UserNotFoundException $ex ) {
3638
$model->user = null;
39+
} catch ( InvalidArgumentException $ex ) {
40+
$model->user = null;
3741
}
3842

3943
if ( $model->user ) {

0 commit comments

Comments
 (0)