From c886c09cdb2878f2b0e53939f7afce9eab71e44f Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 29 Apr 2019 11:08:35 +0900 Subject: MisskeyPagesで値が0の変数が表示されない問題を修正 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app/common/scripts/aiscript.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/client/app/common/scripts/aiscript.ts') diff --git a/src/client/app/common/scripts/aiscript.ts b/src/client/app/common/scripts/aiscript.ts index aea89ff9a3..a3e499fc88 100644 --- a/src/client/app/common/scripts/aiscript.ts +++ b/src/client/app/common/scripts/aiscript.ts @@ -316,8 +316,10 @@ export class AiScript { @autobind private interpolate(str: string, values: { name: string, value: any }[]) { - return str.replace(/\{(.+?)\}/g, match => - (this.getVariableValue(match.slice(1, -1).trim(), values) || '').toString()); + return str.replace(/\{(.+?)\}/g, match => { + const v = this.getVariableValue(match.slice(1, -1).trim(), values); + return v == null ? 'NULL' : v.toString(); + }); } @autobind -- cgit v1.2.3-freya