davsclaus opened a new pull request, #24787: URL: https://github.com/apache/camel/pull/24787
## Summary `SmbOperations.existsFile()` accesses the `share` field without calling `connectIfNecessary()` first. When `tempPrefix` or `tempFileName` is configured on the producer, `GenericFileProducer.processExchange()` calls `existsFile()` **before** any `storeFile()`, and since `SmbEndpoint.isSingletonProducer()` returns `false`, every exchange gets a fresh, unconnected `SmbOperations` — so `share` is always `null`, causing an NPE on every message. ### Changes - **`SmbOperations.existsFile()`** — added `connectIfNecessary()` and `safeDisconnect` error handling, matching the pattern used by `deleteFile()`, `existsFolder()`, `renameFile()`, etc. - **`SmbOperations.storeFileDirectly()`** — added `connectIfNecessary()` (used for checksum file writing, had the same missing guard). - **New IT: `SmbProducerTempPrefixIT`** — verifies that `tempPrefix=.uploading` works on the SMB producer. ## Test plan - [x] New `SmbProducerTempPrefixIT` passes (sends a file with `tempPrefix`, verifies it arrives at the expected path) - [x] Full camel-smb test suite passes (81 tests, 0 failures) _Claude Code on behalf of @davsclaus_ Co-Authored-By: Claude Opus 4.6 <[email protected]> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
