Manage empty returns

This commit is contained in:
Paulo Gustavo Veiga 2022-03-07 07:35:08 -08:00
parent 0329798f15
commit 49bd6767ff

View File

@ -38,7 +38,7 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => {
if (fetchResult.error) {
throw new Error(`User coild not be loaded: ${JSON.stringify(fetchResult.error)}`);
}
result = fetchResult.map.role === 'owner' ? 'edition-owner' : 'edition-editor';
result = fetchResult?.map?.role === 'owner' ? 'edition-owner' : 'edition-editor';
}
}
return result;