Fix error in FileTile when metadata is unavailable
This commit is contained in:
parent
bb26b5372a
commit
1f4ec440df
1 changed files with 2 additions and 1 deletions
|
@ -177,7 +177,8 @@ export let FileTile = React.createClass({
|
||||||
this._isMounted = true;
|
this._isMounted = true;
|
||||||
|
|
||||||
lbry.resolveName(this.props.name, (metadata) => {
|
lbry.resolveName(this.props.name, (metadata) => {
|
||||||
if (this._isMounted) {
|
if (this._isMounted && metadata) {
|
||||||
|
// In case of a failed lookup, metadata will be null, in which case the component will never display
|
||||||
this.setState({
|
this.setState({
|
||||||
sdHash: metadata.sources.lbry_sd_hash,
|
sdHash: metadata.sources.lbry_sd_hash,
|
||||||
metadata: metadata,
|
metadata: metadata,
|
||||||
|
|
Loading…
Add table
Reference in a new issue