Skip to content
Snippets Groups Projects
Unverified Commit 9cc4dcf4 authored by Tim Mickel's avatar Tim Mickel
Browse files

Fix id for selected item, return when CostumeCanvas draw fails

parent bd22602a
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,9 @@ class CostumeCanvas extends React.Component { ...@@ -25,6 +25,9 @@ class CostumeCanvas extends React.Component {
} }
} }
draw () { draw () {
if (!this.refs.costumeCanvas) {
return;
}
// Draw the costume to the rendered canvas. // Draw the costume to the rendered canvas.
const img = this.img; const img = this.img;
const context = this.refs.costumeCanvas.getContext('2d'); const context = this.refs.costumeCanvas.getContext('2d');
......
...@@ -28,8 +28,8 @@ class LibraryComponent extends React.Component { ...@@ -28,8 +28,8 @@ class LibraryComponent extends React.Component {
return <LibraryItem return <LibraryItem
name={dataItem.name} name={dataItem.name}
iconURL={scratchURL} iconURL={scratchURL}
key={'item_' + itemId} key={'item_' + id}
selected={this.state.selectedItem == itemId} selected={this.state.selectedItem == id}
onSelect={this.onSelect} onSelect={this.onSelect}
id={id} />; id={id} />;
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment