Skip to content

🔧 Fix Code Quality: Unguarded file read causes FileNotFoundException if dependency report is absent#1

Open
manos-saratsis wants to merge 1 commit into
developmentfrom
orchestrai/fix-code_quality-1771978218272
Open

🔧 Fix Code Quality: Unguarded file read causes FileNotFoundException if dependency report is absent#1
manos-saratsis wants to merge 1 commit into
developmentfrom
orchestrai/fix-code_quality-1771978218272

Conversation

@manos-saratsis

Copy link
Copy Markdown
Owner

Issue Fixed

Type: Code Quality
File: Dangerfile.df.kts
Line: 30

Description

In Dangerfile.df.kts, updatesFile.readLines() is called without first checking updatesFile.exists(). If the dependencyUpdates Gradle task has not been executed prior to the Danger step, the file will not exist and a FileNotFoundException will be thrown, crashing the Danger check entirely and producing a misleading CI failure.

Suggested Fix

Guard the read with an existence check: if (updatesFile.exists()) { val lines = updatesFile.readLines() /* process lines */ } else { warn("Dependency updates report not found.") }

Changes Made

  • Applied AI-generated fix to resolve the issue
  • Preserved existing code structure and style

Generated by OrchestrAI Software Engineer

…ion if dependency report is absent

File: Dangerfile.df.kts
In Dangerfile.df.kts, updatesFile.readLines() is called without first checking updatesFile.exists(). If the dependencyUpdates Gradle task has not been executed prior to the Danger step, the file will not exist and a FileNotFoundException will be thrown, crashing the Danger check entirely and producing a misleading CI failure.

Generated by OrchestrAI Code Fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant