Skip to content

Commit 788bf41

Browse files
authored
Handle when get_disputes_needing_response() returns non-array. (#6603)
1 parent afe0f8e commit 788bf41

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: fix
3+
Comment: Changes fixed by this change was not yet out to users.
4+
5+

includes/admin/tasks/class-wc-payments-task-disputes.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ public function get_title() {
102102
}
103103

104104
$active_disputes = $this->get_disputes_needing_response();
105-
$currencies_map = [];
105+
if ( ! is_array( $active_disputes ) || count( $active_disputes ) === 0 ) {
106+
return '';
107+
}
108+
109+
$currencies_map = [];
106110
foreach ( $active_disputes as $dispute ) {
107111
if ( ! isset( $currencies_map[ $dispute['currency'] ] ) ) {
108112
$currencies_map[ $dispute['currency'] ] = 0;

0 commit comments

Comments
 (0)