Skip to content

Commit

Permalink
Integrations config: fallback to empty array when $slug for the integ…
Browse files Browse the repository at this point in the history
…rations is missing from integrations.json (#1049)
  • Loading branch information
rinatkhaziev authored Jan 24, 2025
1 parent e74f976 commit f0ab2fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wordpress/dev-tools/dev-env-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
add_filter( 'vip_integrations_pre_load_config', function ( $config, $path, $slug ) {
if ( is_null( $config ) && is_readable( $path ) ) {
$json = json_decode( file_get_contents( $path ), true );
if ( is_array( $json ) && isset( $json[ $slug ] ) ) {
$config = $json[ $slug ];
if ( is_array( $json ) ) {
$config = $json[ $slug ] ?? [];
}
}

Expand Down

0 comments on commit f0ab2fd

Please sign in to comment.