File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 2
2
"main" : " index.js" ,
3
3
"name" : " libsession_util_nodejs" ,
4
4
"description" : " Wrappers for the Session Util Library" ,
5
- "version" : " 0.5.4 " ,
5
+ "version" : " 0.5.5 " ,
6
6
"license" : " GPL-3.0" ,
7
7
"author" : {
8
8
"name" : " Oxen Project" ,
Original file line number Diff line number Diff line change @@ -428,9 +428,16 @@ Napi::Value MetaGroupWrapper::infoSet(const Napi::CallbackInfo& info) {
428
428
this ->meta_group ->info ->set_profile_pic (profilePic);
429
429
}
430
430
431
- if (auto description = maybeNonemptyString (
432
- obj.Get (" description" ), " MetaGroupWrapper::setInfo description" )) {
433
- this ->meta_group ->info ->set_description_truncated (*description);
431
+ // Note: maybeNonemptyString returns nullopt when the string is null, undefined or empty.
432
+ // in the context of infoSet, `description` is a bit of a custom one as:
433
+ // - null/undefined means no change to the current value stored,
434
+ // - empty string means set to empty string (i.e. clear it).
435
+ // Because of this custom behavior, we need those manual checks in place.
436
+ if (auto description = obj.Get (" description" )) {
437
+ if (description.IsString ()) {
438
+ this ->meta_group ->info ->set_description_truncated (
439
+ description.ToString ().Utf8Value ());
440
+ }
434
441
}
435
442
436
443
return this ->infoGet (info);
You can’t perform that action at this time.
0 commit comments