Skip to content

Fixed typed nil pointer bug in sftp backend. Fixes #274.#275

Merged
funkyshu merged 3 commits intomainfrom
typed_nil_pointer_bug_274
Aug 7, 2025
Merged

Fixed typed nil pointer bug in sftp backend. Fixes #274.#275
funkyshu merged 3 commits intomainfrom
typed_nil_pointer_bug_274

Conversation

@funkyshu
Copy link
Member

@funkyshu funkyshu commented Aug 7, 2025

See #274

@c2fo-cibot c2fo-cibot bot added the size/L Denotes a PR that changes 100-499 lines label Aug 7, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a typed nil pointer bug in the SFTP backend that was causing panics when connection failures resulted in typed nil interface values. The fix adds an additional nil check using reflection to detect typed nil pointers alongside the standard nil check.

  • Added reflection-based typed nil detection in the SFTP client getter
  • Comprehensive test suite for concurrency and failure scenarios
  • Updated changelog to document the fix

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
backend/sftp/fileSystem.go Added reflection import and typed nil check in Client() method
backend/sftp/concurrency_test.go New comprehensive test suite covering typed nil handling and concurrency scenarios
CHANGELOG.md Added entry documenting the bug fix

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@funkyshu funkyshu merged commit 6edd449 into main Aug 7, 2025
27 checks passed
@funkyshu funkyshu deleted the typed_nil_pointer_bug_274 branch August 7, 2025 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants