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
|
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,
|
||||||
|
|
Loading…
Add table
Reference in a new issue