!152 jscrash of nameClick/addContact/touchMove on master

Merge pull request !152 from zhouhongli2023/master
This commit is contained in:
openharmony_ci 2024-09-10 02:07:34 +00:00 committed by Gitee
commit 102d4b088a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 6 additions and 2 deletions

View File

@ -341,7 +341,7 @@ export default class ConversationListController {
}
let item = this.messageList[this.itemTouchedIdx];
let transX = offsetX;
if (item.isDelShow) {
if (item && item.isDelShow) {
if (event.offsetX - this.operateBtnW <= 0) {
transX = event.offsetX - this.operateBtnW
} else {

View File

@ -267,6 +267,10 @@ export default class ReceiveController {
if (this.checkSingle()) {
return;
}
if (curItem == undefined) {
HiLog.e(TAG, 'addContact contact is null');
return;
}
if (curItem != undefined && curItem.telephone != undefined && curItem.telephone.toString().trim() == '') {
prompt.showToast({
// Invalid Recipient
@ -352,7 +356,7 @@ export default class ReceiveController {
if (this.selectContacts[idx] == null || this.selectContacts[idx] == undefined) {
return;
}
if (this.selectContacts[idx].select) {
if (this.selectContacts[idx].select && this.selectContacts[idx].select != undefined) {
let item = this.selectContacts.splice(idx, 1);
// Deleted items are added to the collection to be searched.
this.contactsTemp.push(item);