Skip to content

Commit

Permalink
Merge pull request #413 from verdigado/fix-393
Browse files Browse the repository at this point in the history
Avoid PHP error if ics calendar cannot be reached
  • Loading branch information
albig authored Oct 31, 2023
2 parents 631183e + 58b578f commit 80f2f29
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ jobs:
contents: write
needs: build
steps:
- uses: actions/checkout@v4
- name: fail on fork
if: github.repository_owner != 'verdigado'
run: exit 1
if: github.repository_owner != 'verdigado'
run: exit 1

- uses: actions/checkout@v4
- name: Echo debug
run: |
echo "sunflower-${{ github.ref_name }}.zip"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ documentation/
build/
assets/vndr/
.favorites.json
.vscode/settings.json
.vscode
pa11y.json
6 changes: 4 additions & 2 deletions functions/icalimport.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,10 @@ function sunflower_import_icals( $force = false ) {
continue;
}

$response = sunflower_icalimport( $url, $auto_categories );
$ids_from_remote = array_merge( $ids_from_remote, $response[0] );
$response = sunflower_icalimport( $url, $auto_categories );
if ( !empty( $response ) ) {
$ids_from_remote = array_merge( $ids_from_remote, $response[0] );
}
}

$deleted_on_remote = array_diff( sunflower_get_events_having_uid(), $ids_from_remote );
Expand Down

0 comments on commit 80f2f29

Please sign in to comment.