Skip to content

Commit 2a1cf72

Browse files
authored
Merge pull request #259 from grobx/arduino/master
Fix hard fault when str is NULL
2 parents 991f076 + cd9cbad commit 2a1cf72

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/utility/BLEUuid.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ BLEUuid::BLEUuid(const char * str) :
3030
memset(_data, 0x00, sizeof(_data));
3131

3232
_length = 0;
33+
34+
if (str == NULL) {
35+
return;
36+
}
37+
3338
for (int i = strlen(str) - 1; i >= 0 && _length < BLE_UUID_MAX_LENGTH; i -= 2) {
3439
if (str[i] == '-') {
3540
i++;

0 commit comments

Comments
 (0)