Merge pull request #457 from jamebal/dev

fix: add null checks for refs before invoking methods to prevent pote…
This commit is contained in:
jmal 2025-08-07 16:55:47 +08:00 committed by GitHub
commit f44f438508
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 4 deletions

View File

@ -313,7 +313,9 @@ export default {
this.fileList.map((item, index) => { this.fileList.map((item, index) => {
item.index = index item.index = index
}) })
this.$refs.fileListTable.reloadData(this.fileList) if (this.$refs.fileListTable) {
this.$refs.fileListTable.reloadData(this.fileList)
}
setTimeout(() => { setTimeout(() => {
if (this.$refs.fileListTable) { if (this.$refs.fileListTable) {
this.$refs.fileListTable.reloadData(this.fileList) this.$refs.fileListTable.reloadData(this.fileList)

View File

@ -282,7 +282,7 @@ export default {
item.searchOverall = false item.searchOverall = false
} }
this.debounceSearch(this.searchFileName, false) this.debounceSearch(this.searchFileName, false)
this.$refs.searchOption.setFilterOption(item) this.$refs.searchOption && this.$refs.searchOption.setFilterOption(item)
this.$nextTick(() => { this.$nextTick(() => {
this._isSuggestionHandledBySelect = false this._isSuggestionHandledBySelect = false
}) })

View File

@ -50,7 +50,7 @@ export default {
event.stopPropagation() event.stopPropagation()
} }
// Del // Del
if (keyCode === 8 && !this.inputting && this.selectRowData.length > 0 && !checkPreviewVisible) { if (keyCode === 46 && !this.inputting && this.selectRowData.length > 0 && !checkPreviewVisible) {
this.removeOperation() this.removeOperation()
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
@ -91,7 +91,9 @@ export default {
} }
// ctrl + P / cmd + P // ctrl + P / cmd + P
if (isCmd && keyCode === 80 && !checkPreviewVisible) { if (isCmd && keyCode === 80 && !checkPreviewVisible) {
this.$refs.searchInput.focus() if (this.$refs.searchInput) {
this.$refs.searchInput.focus()
}
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
} }