Skip to content

Commit

Permalink
Avoid PHP error if ics calendar cannot be reached
Browse files Browse the repository at this point in the history
  • Loading branch information
albig committed Oct 31, 2023
1 parent 631183e commit 61bc3db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .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

- 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 61bc3db

Please sign in to comment.