aboutsummaryrefslogtreecommitdiff
path: root/src/client/react
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 /src/client/react
parent15dc5ccd08ce323a48edaa53dfcec24b7151e3af (diff)
client/IconFromUserType: Throw within if
Diffstat (limited to 'src/client/react')
-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;
}
}
}