Skip to content

Commit

Permalink
Merge pull request #19 from jamiefaye/dev
Browse files Browse the repository at this point in the history
Guard for missing osc2 object
  • Loading branch information
jamiefaye authored Aug 5, 2018
2 parents c6f8159 + d296253 commit 336efaf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions DR/xmlView/viewXML.htm
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@
<meta charset="UTF-8">
<title>Downrush XML Viewer</title>
<!-- https://stackoverflow.com/questions/951791/javascript-global-error-handling -->
<div id="npoptemp" style="display: none;"></div>

<script type="text/javascript">

window.onerror = function(msg, url, line, col, error) {
window.onerror = function(msg, url, line, col, error) {
var extra = !col ? '' : '\ncolumn: ' + col;
extra += !error ? '' : '\nerror: ' + error;
alert("Error: " + msg + "\nurl: " + url + "\nline: " + line + extra);
return true;
};
</script>

<div id="npoptemp" style="display: none;"></div>
<link rel="stylesheet" href="edit.css">
<link rel="stylesheet" href="filewidget.css">
</head>
Expand Down
2 changes: 1 addition & 1 deletion xmlView/src/KitList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class EditButtons extends React.Component {
render() {
if (this.props.channel) return this.renderMidi();
let o2 = this.props.osc2;
let hasB = o2.fileName && !$.isEmptyObject(o2.fileName);
let hasB = o2 && o2.fileName && !$.isEmptyObject(o2.fileName);
return (<tbody>
<SampleEntry className='kitentry' ref={el => this.kitref = el} kito={this.props.kito} checker={this.checker} osc2={false}
editing={this.props.editing} index={this.props.index} name={this.props.name} key='osc1' osc={this.props.osc1} />
Expand Down

0 comments on commit 336efaf

Please sign in to comment.