Skip to content

Commit

Permalink
Merge pull request #2230 from msawicki/fix/term-syncmanager-null-term
Browse files Browse the repository at this point in the history
Adds check for term before capability check
  • Loading branch information
felipeelia authored Jun 25, 2021
2 parents ebe68ed + 2b8398d commit b607dd0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion includes/classes/Indexable/Term/SyncManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ public function action_sync_on_object_update( $object_id, $terms ) {
}

foreach ( $terms as $term ) {
$term = get_term( $term );
$term_info = term_exists( $term );

if ( ! $term_info ) {
continue;
}

$term = get_term( $term_info );

if ( ! current_user_can( 'edit_term', $term->term_id ) ) {
return;
Expand Down

0 comments on commit b607dd0

Please sign in to comment.