Skip to content

Commit

Permalink
Make sure NativeQueryEditor doesn't crash if ace isn't available. Was…
Browse files Browse the repository at this point in the history
… causing integration test failure
  • Loading branch information
tlrobinson committed Mar 21, 2018
1 parent febe98b commit 20846dd
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -178,7 +178,13 @@ export default class NativeQueryEditor extends Component {
const { query } = this.props;

let editorElement = ReactDOM.findDOMNode(this.refs.editor);

// $FlowFixMe
if (typeof ace === "undefined" || !ace || !ace.edit) {
// fail gracefully-ish if ace isn't available, e.x. in integration tests
return;
}

this._editor = ace.edit(editorElement);

// listen to onChange events
Expand Down

0 comments on commit 20846dd

Please sign in to comment.