From 50296e76ee535fff28bc46b752b99babbd568321 Mon Sep 17 00:00:00 2001 From: Menci Date: Sun, 21 Apr 2019 15:30:34 +0800 Subject: [PATCH] Fix TypeError when query cached model not found --- models/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/common.ts b/models/common.ts index ecedc18..f9ac858 100644 --- a/models/common.ts +++ b/models/common.ts @@ -48,7 +48,7 @@ export default class Model extends TypeORM.BaseEntity { if (result) { cacheSet(this.name, id, result); } - return result.clone(); + return result && result.clone(); } else { return await doQuery(); }