diff --git a/.github/workflows/global_workflow.yml b/.github/workflows/global_workflow.yml index af1fc2c8..a69462f9 100644 --- a/.github/workflows/global_workflow.yml +++ b/.github/workflows/global_workflow.yml @@ -29,8 +29,8 @@ jobs: run: ./gradlew sonar --info - name: Analyse pull request - # If pull request, we analyze the code - if: github.event_name == 'pull_request' + # If pull request, we analyze the code, and if the target branch is not master + if: github.event_name == 'pull_request' && github.event.pull_request.base.ref != 'master' env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} diff --git a/src/main/kotlin/fr/shikkanime/services/ImageService.kt b/src/main/kotlin/fr/shikkanime/services/ImageService.kt index ebb2696e..1d34491a 100644 --- a/src/main/kotlin/fr/shikkanime/services/ImageService.kt +++ b/src/main/kotlin/fr/shikkanime/services/ImageService.kt @@ -470,7 +470,9 @@ object ImageService { private fun loadResources(episode: EpisodeDto): Tuple { val mediaImageFolder = - File(ClassLoader.getSystemClassLoader().getResource("media-image")!!.file).takeIf { it.exists() } ?: File( + ClassLoader.getSystemClassLoader() + .getResource("media-image")?.file?.let { File(it).takeIf { file -> file.exists() } } + ?: File( Constant.dataFolder, "media-image" )