mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
if remix parent or original is unshared, don't crash project page
This commit is contained in:
parent
4587736684
commit
634d6c93e0
2 changed files with 9 additions and 0 deletions
|
@ -394,6 +394,10 @@ module.exports.getOriginalInfo = id => (dispatch => {
|
|||
return;
|
||||
}
|
||||
dispatch(module.exports.setFetchStatus('original', module.exports.Status.FETCHED));
|
||||
if (body && body.code === 'NotFound') {
|
||||
dispatch(module.exports.setOriginalInfo({}));
|
||||
return;
|
||||
}
|
||||
dispatch(module.exports.setOriginalInfo(body));
|
||||
});
|
||||
});
|
||||
|
@ -414,6 +418,10 @@ module.exports.getParentInfo = id => (dispatch => {
|
|||
return;
|
||||
}
|
||||
dispatch(module.exports.setFetchStatus('parent', module.exports.Status.FETCHED));
|
||||
if (body && body.code === 'NotFound') {
|
||||
dispatch(module.exports.setParentInfo({}));
|
||||
return;
|
||||
}
|
||||
dispatch(module.exports.setParentInfo(body));
|
||||
});
|
||||
});
|
||||
|
|
|
@ -8,6 +8,7 @@ const thumbnailUrl = require('../../lib/user-thumbnail');
|
|||
const RemixCredit = props => {
|
||||
const projectInfo = props.projectInfo;
|
||||
if (Object.keys(projectInfo).length === 0) return null;
|
||||
if (!projectInfo.author) return null;
|
||||
return (
|
||||
<FlexRow className="remix-credit">
|
||||
<Avatar
|
||||
|
|
Loading…
Reference in a new issue