diff --git a/src/pages/common/PostCollect.vue b/src/pages/common/PostCollect.vue index 00eb202a..080379d7 100644 --- a/src/pages/common/PostCollect.vue +++ b/src/pages/common/PostCollect.vue @@ -439,7 +439,11 @@ function getPageItems(): TGApp.Plugins.Mys.Post.FullData[] { card.push(JSON.parse(post.content)); } catch (e) { TGLogger.Error("[PostCollect] getPageItems"); - TGLogger.Error(e); + if (typeof e === "string") { + TGLogger.Error(e); + } else if (e instanceof Error) { + TGLogger.Error(e.message); + } } } return card; diff --git a/src/plugins/Sqlite/modules/userCollect.ts b/src/plugins/Sqlite/modules/userCollect.ts index 5d069180..d6a38892 100644 --- a/src/plugins/Sqlite/modules/userCollect.ts +++ b/src/plugins/Sqlite/modules/userCollect.ts @@ -1,7 +1,7 @@ /** * @file plugins/Sqlite/modules/userCollect.ts * @description 用户收藏模块 - * @since Beta v0.5.1 + * @since Beta v0.5.5 */ import TGSqlite from "../index.js"; @@ -41,7 +41,7 @@ async function getCollectList(): Promise} 返回收藏合集中的帖子列表 */ @@ -55,7 +55,7 @@ async function getCollectPostList( for (let i = 0; i < res.length; i++) { const postSql = "SELECT * FROM UFPost WHERE id = ?"; const postRes: TGApp.Sqlite.UserCollection.UFPost[] = await db.select(postSql, [res[i].postId]); - postList.push(postRes[0]); + if (postRes.length > 0) postList.push(postRes[0]); } return postList; }