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 22 "main" : " index.js" ,
33 "name" : " libsession_util_nodejs" ,
44 "description" : " Wrappers for the Session Util Library" ,
5- "version" : " 0.5.4 " ,
5+ "version" : " 0.5.5 " ,
66 "license" : " GPL-3.0" ,
77 "author" : {
88 "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) {
428428 this ->meta_group ->info ->set_profile_pic (profilePic);
429429 }
430430
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+ }
434441 }
435442
436443 return this ->infoGet (info);
You can’t perform that action at this time.
0 commit comments