File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -221,11 +221,16 @@ function (Filter\Condition $condition) {
221221
222222 $ contactId = $ this ->getContactId ($ identifier );
223223 if ($ contactId !== null ) {
224- $ db -> update ( ' contact ' , [
224+ $ toUpdate = [
225225 'full_name ' => $ data ['full_name ' ],
226- 'username ' => $ data ['username ' ] ?? null ,
227226 'default_channel_id ' => $ this ->getChannelId ($ data ['default_channel ' ])
228- ], ['id = ? ' => $ contactId ]);
227+ ];
228+
229+ if (! empty ($ data ['username ' ])) {
230+ $ toUpdate ['username ' ] = $ data ['username ' ];
231+ }
232+
233+ $ db ->update ('contact ' , $ toUpdate , ['id = ? ' => $ contactId ]);
229234
230235 $ db ->delete ('contact_address ' , ['contact_id = ? ' => $ contactId ]);
231236 $ db ->delete ('contactgroup_member ' , ['contact_id = ? ' => $ contactId ]);
You can’t perform that action at this time.
0 commit comments