Skip to content

Fix crash when copying empty Tuya config to clipboard#82

Merged
openshwprojects merged 1 commit intoopenshwprojects:mainfrom
divadiow:tuyaconfigcopy
Dec 7, 2025
Merged

Fix crash when copying empty Tuya config to clipboard#82
openshwprojects merged 1 commit intoopenshwprojects:mainfrom
divadiow:tuyaconfigcopy

Conversation

@divadiow
Copy link
Contributor

@divadiow divadiow commented Dec 6, 2025

Added null/empty checks and try/catch around Clipboard.SetText in the two Tuya copy handlers (buttonTuyaConfig_CopyJSONToClipBoard_Click and buttonTuyaConfig_CopyTextToClipBoard_Click) so the app no longer throws ArgumentNullException when the text boxes are empty. Shows a small informational message instead of crashing.

@divadiow
Copy link
Contributor Author

divadiow commented Dec 6, 2025

before when clicking copy to clipboard if boxes are empty:
image

with PR on empty copy:
image
image

continues to copy to clipboard the correct text if present

@openshwprojects openshwprojects merged commit 3fc7f60 into openshwprojects:main Dec 7, 2025
2 checks passed
@divadiow divadiow deleted the tuyaconfigcopy branch January 4, 2026 11:56
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.

2 participants