Skip to content

Commit

Permalink
Guard against no namespace passed into a can/cannot helper
Browse files Browse the repository at this point in the history
This can happen if a job doesn't have a namespace (which shouldn't
actually ever happen, but it can in tests).
  • Loading branch information
DingoEatingFuzz committed Apr 29, 2021
1 parent a81e2b8 commit 735f056
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ui/app/abilities/abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default class Abstract extends Ability {
namespace = 'default';

get _namespace() {
if (!this.namespace) return 'default';
if (typeof this.namespace === 'string') return this.namespace;
return get(this.namespace, 'name');
}
Expand Down

0 comments on commit 735f056

Please sign in to comment.