Skip to content

Commit

Permalink
Merge pull request #134 from 1gor/patch-1
Browse files Browse the repository at this point in the history
Check that role exists when removing capability
  • Loading branch information
chandrapatel authored Apr 11, 2018
2 parents 1eea772 + d67e052 commit 599a3e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions admin/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ function rt_wp_nginx_helper_remove_capability( $capability ) {

foreach ( $check_order as $role ) {
$role = get_role( $role );
$role->remove_cap( $capability );
if ($role) {
$role->remove_cap( $capability );
}
}
}

Expand Down Expand Up @@ -97,4 +99,4 @@ function rt_wp_nginx_helper_get_options() {

return $rt_wp_nginx_helper_get_options;
}
}
}

0 comments on commit 599a3e2

Please sign in to comment.