mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
[AC-1879] Add null check for collection view helpers (#7073)
* [AC-1879] Add null check for collection view helpers * [AC-1879] Add additional null check to organization-options.component.ts
This commit is contained in:
@@ -33,7 +33,7 @@ export class CollectionView implements View, ITreeNodeObject {
|
||||
|
||||
// For editing collection details, not the items within it.
|
||||
canEdit(org: Organization, flexibleCollectionsEnabled: boolean): boolean {
|
||||
if (org.id !== this.organizationId) {
|
||||
if (org != null && org.id !== this.organizationId) {
|
||||
throw new Error(
|
||||
"Id of the organization provided does not match the org id of the collection.",
|
||||
);
|
||||
@@ -46,7 +46,7 @@ export class CollectionView implements View, ITreeNodeObject {
|
||||
|
||||
// For deleting a collection, not the items within it.
|
||||
canDelete(org: Organization, flexibleCollectionsEnabled: boolean): boolean {
|
||||
if (org.id !== this.organizationId) {
|
||||
if (org != null && org.id !== this.organizationId) {
|
||||
throw new Error(
|
||||
"Id of the organization provided does not match the org id of the collection.",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user