Skip to content

Commit

Permalink
Throw bad request when line or column have negative values (#298)
Browse files Browse the repository at this point in the history
Co-authored-by: mgarciavaadin <[email protected]>
  • Loading branch information
MarcinVaadin and mgarciavaadin authored Feb 5, 2025
1 parent fc8dc9f commit 8df7fdc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ class ShowInIdeHandler(project: Project, data: Map<String, Any>) : AbstractHandl
private val column: Int = (data["column"] as Int?) ?: 0

override fun run(): HandlerResponse {
if (line < 0 || column < 0) {
LOG.warn("Invalid line or column number ($line:$column)")
return RESPONSE_BAD_REQUEST
}
if (isFileInsideProject(project, ioFile)) {
val result =
VfsUtil.findFileByIoFile(ioFile, true)?.let { file ->
Expand Down

0 comments on commit 8df7fdc

Please sign in to comment.