fixup 493c1a65: missed some null checks and a return
This commit is contained in:
parent
c4690a839f
commit
fc0b1dc739
|
@ -430,7 +430,7 @@ function showLinterErrorMessage(title, contents, popup) {
|
|||
contents,
|
||||
className: 'danger center lint-config',
|
||||
buttons: [t('confirmOK')],
|
||||
}).then(() => popup && popup.codebox.focus());
|
||||
}).then(() => popup && popup.codebox && popup.codebox.focus());
|
||||
}
|
||||
|
||||
function setupLinterPopup(config) {
|
||||
|
@ -514,6 +514,7 @@ function setupLinterPopup(config) {
|
|||
if (!json) {
|
||||
showLinterErrorMessage(linter, t('linterJSONError'), popup);
|
||||
cm.focus();
|
||||
return;
|
||||
}
|
||||
linterConfig.findInvalidRules(json, linter).then(invalid => {
|
||||
if (invalid.length) {
|
||||
|
@ -536,9 +537,7 @@ function setupLinterPopup(config) {
|
|||
|
||||
function reset(event) {
|
||||
event.preventDefault();
|
||||
if (linterConfig.getName() !== linter) {
|
||||
linterConfig.setLinter(linter);
|
||||
}
|
||||
cm.setValue(defaultConfig);
|
||||
cm.focus();
|
||||
updateButtonState();
|
||||
|
|
Loading…
Reference in New Issue
Block a user