summaryrefslogtreecommitdiff
path: root/src/client/app/common/scripts/aiscript.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-04-29 11:08:35 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-04-29 11:08:35 +0900
commitc886c09cdb2878f2b0e53939f7afce9eab71e44f (patch)
treeae38afe9f7b1598500fff0c77703e63e263f28a2 /src/client/app/common/scripts/aiscript.ts
parentFix error (diff)
downloadsharkey-c886c09cdb2878f2b0e53939f7afce9eab71e44f.tar.gz
sharkey-c886c09cdb2878f2b0e53939f7afce9eab71e44f.tar.bz2
sharkey-c886c09cdb2878f2b0e53939f7afce9eab71e44f.zip
MisskeyPagesで値が0の変数が表示されない問題を修正
Diffstat (limited to 'src/client/app/common/scripts/aiscript.ts')
-rw-r--r--src/client/app/common/scripts/aiscript.ts6
1 files changed, 4 insertions, 2 deletions
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