🐛 Fix(custom): avoid undefined error

This commit is contained in:
Kuingsmile
2026-01-28 11:10:05 +08:00
parent 07453b0774
commit c1b1350757
2 changed files with 3 additions and 3 deletions

View File

@@ -106,7 +106,7 @@ class RemoteNoticeHandler {
switch (action.type) {
case IRemoteNoticeActionType.SHOW_DIALOG: {
const currentWindow = windowManager.getAvailableWindow()
dialog.showOpenDialog(currentWindow, action.data?.options)
dialog.showOpenDialog(currentWindow!, action.data?.options)
break
}
case IRemoteNoticeActionType.SHOW_NOTICE:
@@ -138,7 +138,7 @@ class RemoteNoticeHandler {
case IRemoteNoticeActionType.SHOW_MESSAGE_BOX: {
const currentWindow = windowManager.getAvailableWindow()
dialog
.showMessageBox(currentWindow, {
.showMessageBox(currentWindow!, {
title: action.data?.title || '',
message: action.data?.content || '',
type: 'info',

View File

@@ -124,7 +124,7 @@ router.post(
}
})
const win = windowManager.getAvailableWindow()
const result = await uploadChoosedFiles(win.webContents, pathList)
const result = await uploadChoosedFiles(win?.webContents, pathList)
const res = result.map(item => {
return useShortUrl ? item.fullResult.shortUrl || item.url : item.url
})