[ftr/verbose_instance] check for .finally() before using it (#88998)

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Spencer 2021-01-21 14:51:29 -07:00 committed by GitHub
parent f6689729ea
commit cacce7a866
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,7 +65,11 @@ export function createVerboseInstance(
}
const { returned } = result;
if (returned && typeof returned.then === 'function') {
if (
returned &&
typeof returned.then === 'function' &&
typeof returned.finally === 'function'
) {
return returned.finally(() => {
log.indent(-2);
});