Skip to content

Commit 3b2e1aa

Browse files
deal with empty data sets
1 parent d68b6ee commit 3b2e1aa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

classes/Visualizer/Render/Layout.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,15 @@ public static function _renderEditorTable( $args ) {
427427
if ( array_key_exists( 'data', $data ) ) {
428428
$data = $data['data'];
429429
}
430+
430431
foreach ( $data as $row ) {
431432
echo '<tr>';
432433
echo '<th>' . __( 'Value', 'visualizer' ) . '</th>';
433434
$index = 0;
435+
if ( empty( $row ) ) {
436+
echo '<td></td>';
437+
continue;
438+
}
434439
foreach ( array_values( $row ) as $value ) {
435440
if ( $editable_data ) {
436441
echo '<td><input type="text" name="data' . $index++ . '[]" value="' . esc_attr( $value ) . '"></td>';

0 commit comments

Comments
 (0)