You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2019/07/26 10:27:03 UTC
[sling-whiteboard] 03/03: Fix 'action not found' case
This is an automated email from the ASF dual-hosted git repository.
bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
commit 9f00339937811e792cfbba3a493974266b183dc0
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Jul 26 12:26:48 2019 +0200
Fix 'action not found' case
---
serverless-microsling/lib/openwhisk-renderer.js | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/serverless-microsling/lib/openwhisk-renderer.js b/serverless-microsling/lib/openwhisk-renderer.js
index a323f94..5ac5259 100644
--- a/serverless-microsling/lib/openwhisk-renderer.js
+++ b/serverless-microsling/lib/openwhisk-renderer.js
@@ -33,10 +33,14 @@ const getActionInfo = async (resourceType, extension) => {
const act = actions.find(act => {
return resourceType == getAnnotation(act, 'sling:resourceType') && extension == getAnnotation(act, 'sling:extensions')
})
- resolve({
- action: act,
- contentType: getAnnotation(act, 'sling:contentType'),
- });
+ let result;
+ if(act) {
+ result = {
+ action: act,
+ contentType: getAnnotation(act, 'sling:contentType'),
+ };
+ }
+ resolve(result);
})
.catch(e => {
throw e;