Skip to content

Commit 3bea72f

Browse files
bwp91claude
andcommitted
fix: "undefined" string in characteristic error warnings
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9e0735b commit 3bea72f

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ All notable changes to `@homebridge/hap-nodejs` will be documented in this file.
2121
- fix: category defaulting to string instead of enum
2222
- fix: missing error argument in pairing debug logs
2323
- fix: use constant-time comparison for pincode checks
24+
- fix: `"undefined"` string in characteristic error warnings
2425

2526
## v2.1.2 (2026-03-29)
2627

src/lib/Characteristic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,7 +2118,7 @@ export class Characteristic extends EventEmitter {
21182118
try {
21192119
value = this.validateUserInput(value)!;
21202120
} catch (error) {
2121-
this.characteristicWarning(error?.message + "", CharacteristicWarningType.ERROR_MESSAGE, error?.stack);
2121+
this.characteristicWarning(error?.message || "Unknown error", CharacteristicWarningType.ERROR_MESSAGE, error?.stack);
21222122
if (callback) {
21232123
callback(error);
21242124
}
@@ -2204,7 +2204,7 @@ export class Characteristic extends EventEmitter {
22042204
try {
22052205
value = this.validateUserInput(value);
22062206
} catch (error) {
2207-
this.characteristicWarning(error?.message + "", CharacteristicWarningType.ERROR_MESSAGE, error?.stack);
2207+
this.characteristicWarning(error?.message || "Unknown error", CharacteristicWarningType.ERROR_MESSAGE, error?.stack);
22082208
if (callback) {
22092209
callback();
22102210
}

0 commit comments

Comments
 (0)