fixing some console fatal errors (#21996) (#22057)

This commit is contained in:
Bill McConaghy 2018-08-16 09:52:45 -04:00 committed by GitHub
parent ddc5b554a6
commit 8fa2c7bafe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -181,7 +181,7 @@ function getCurrentMethodAndTokenPaths(editor, pos, forceEndOfUrl) {
}
ret.urlTokenPath = [];
if (tokenIter.getCurrentTokenRow() === startPos.row) {
if (t.type === 'url.part' || t.type === 'url.param' || t.type === 'url.value') {
if (t && (t.type === 'url.part' || t.type === 'url.param' || t.type === 'url.value')) {
// we are forcing the end of the url for the purposes of determining an endpoint
if (forceEndOfUrl && t.type === 'url.part') {
ret.urlTokenPath.push(t.value);

View file

@ -291,6 +291,9 @@ export default function SenseEditor($el) {
editor.getRequestInRange = onceDoneTokenizing(function (range, cb) {
if (!range) {
return;
}
const request = {
method: '',
data: [],
@ -379,6 +382,9 @@ export default function SenseEditor($el) {
}
editor.getRequest(currentRow, function (request) {
if (!request) {
return;
}
explicitRangeToRequests({
start: {
row: request.range.end.row + 1