From 7c5ee1bd0050b7eedf77d9c1e7d6e57483115ba4 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 10 Sep 2018 08:25:52 -0400 Subject: [PATCH] make sure org key exists for collection add/edit --- jslib | 2 +- src/app/organizations/manage/collection-add-edit.component.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/jslib b/jslib index 773c51901f..2d612b07de 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 773c51901fe77165c40cfb018bf5b99a740b5e4a +Subproject commit 2d612b07de588a52e0e5895c4a4593f670442bb9 diff --git a/src/app/organizations/manage/collection-add-edit.component.ts b/src/app/organizations/manage/collection-add-edit.component.ts index 1eb70dd29d..eff40e6855 100644 --- a/src/app/organizations/manage/collection-add-edit.component.ts +++ b/src/app/organizations/manage/collection-add-edit.component.ts @@ -103,6 +103,10 @@ export class CollectionAddEditComponent implements OnInit { } async submit() { + if (this.orgKey == null) { + throw new Error('No encryption key for this organization.'); + } + const request = new CollectionRequest(); request.name = (await this.cryptoService.encrypt(this.name, this.orgKey)).encryptedString; request.groups = this.groups.filter((g) => (g as any).checked && !g.accessAll)