From 8f7bcf27d6ad8e3d13114bd60c942fa8cce279f8 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Tue, 3 Jul 2018 19:36:51 +0200 Subject: client/IconFromUserType: Throw within if --- src/client/react/components/presentational/IconFromUserType.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/react/components/presentational/IconFromUserType.js b/src/client/react/components/presentational/IconFromUserType.js index 0cb5154..43c6c2b 100644 --- a/src/client/react/components/presentational/IconFromUserType.js +++ b/src/client/react/components/presentational/IconFromUserType.js @@ -48,11 +48,11 @@ class IconFromUserType extends React.Component { case 'r': return ; default: - if (defaultIcon) { - return defaultIcon; + if (!defaultIcon) { + throw new Error('`userType` was invalid or not given, but `defaultIcon` is not defined.'); } - throw new Error('`userType` was invalid or not given, but `defaultIcon` is not defined.'); + return defaultIcon; } } } -- cgit v1.1