fix(RolePicker): make sure getInitialProps always returns

Signed-off-by: Katalina Okano <git@kat.cafe>
This commit is contained in:
41666 2020-12-21 05:17:02 -05:00
parent 7f031bb960
commit 7363b4d359

View file

@ -141,12 +141,13 @@ RolePickerPage.getInitialProps = async (context: NextPageContext): Promise<Props
context
);
if (pickerData) {
return {
data: pickerData,
redirect: null,
};
if (!pickerData) {
throw new Error('Picker data failed.');
}
return {
data: pickerData,
redirect: null,
};
} catch (e) {
return {
data: null,