aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-07-03 19:36:51 +0200
committerNoah Loomans <noahloomans@gmail.com>2018-07-03 20:14:11 +0200
commit8f7bcf27d6ad8e3d13114bd60c942fa8cce279f8 (patch)
tree2a4a21ac48cd7dc706c87c04762fbe37ccf6e7b0
parent15dc5ccd08ce323a48edaa53dfcec24b7151e3af (diff)
client/IconFromUserType: Throw within if
-rw-r--r--src/client/react/components/presentational/IconFromUserType.js6
1 files 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 <RoomIcon />;
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;
}
}
}