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 context
); );
if (pickerData) { if (!pickerData) {
return { throw new Error('Picker data failed.');
data: pickerData,
redirect: null,
};
} }
return {
data: pickerData,
redirect: null,
};
} catch (e) { } catch (e) {
return { return {
data: null, data: null,