From 6730182e37287c871b01897b484c4615cef8a3c6 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Wed, 1 Sep 2021 12:38:46 +0200 Subject: [PATCH] Chore: Fix the missing syntax issue in `@wordpress/project-management-automation` Follow-up for #34373. --- .../lib/tasks/add-milestone/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/project-management-automation/lib/tasks/add-milestone/index.js b/packages/project-management-automation/lib/tasks/add-milestone/index.js index 1058f6bc9d7a71..f70a6560bea996 100644 --- a/packages/project-management-automation/lib/tasks/add-milestone/index.js +++ b/packages/project-management-automation/lib/tasks/add-milestone/index.js @@ -27,8 +27,10 @@ const isDuplicateValidationError = ( requestError ) => { // The included version of RequestError provides no way to access the // full 'errors' array that the github REST API returns. Hopefully they // resolve this soon! - const errorMessage = /** @type {undefined | null | {message?: string}} */ ( requestError ) - ?.message; + const errorMessage = + requestError && + typeof requestError === 'object' && + /** @type {{message?: string}} */ ( requestError ).message; return ( typeof errorMessage === 'string' && errorMessage.includes( 'already_exists' )