Manage empty returns

This commit is contained in:
Paulo Gustavo Veiga 2022-03-07 07:35:08 -08:00
parent 8816a5e58d
commit e9d5fee022

View File

@ -38,7 +38,7 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => {
if (fetchResult.error) { if (fetchResult.error) {
throw new Error(`User coild not be loaded: ${JSON.stringify(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; return result;