mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
fix(RolePicker): make sure getInitialProps always returns
Signed-off-by: Katalina Okano <git@kat.cafe>
This commit is contained in:
parent
7f031bb960
commit
7363b4d359
1 changed files with 6 additions and 5 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue