From 9ddd3783f69341a153b19d555c150d0f02fe46bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=8E=89?= Date: Thu, 26 Sep 2024 15:09:33 +0900 Subject: [PATCH] =?UTF-8?q?Bug687=E4=BF=AE=E6=AD=A3(=E6=97=A5=E4=BB=98?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E3=81=AB=E5=80=A4=E9=9D=9E=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E6=99=82=E3=82=A8=E3=83=A9=E3=83=BC=E8=A1=A8=E7=A4=BA=E3=81=AA?= =?UTF-8?q?=E3=81=84Bug)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/kintone-addins/src/actions/date-specified.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/kintone-addins/src/actions/date-specified.ts b/plugin/kintone-addins/src/actions/date-specified.ts index caf13e8..8481e24 100644 --- a/plugin/kintone-addins/src/actions/date-specified.ts +++ b/plugin/kintone-addins/src/actions/date-specified.ts @@ -56,7 +56,10 @@ export class DateSpecifiedAction implements IAction { let verNameGetValue = getContextVarByPath(context.variables,this.props.verNameGet); //////////////////////////////////////////////////////////////////////////////////////////////// //取得変数の値Dateオブジェクトに変換: - let dateObj = new Date(verNameGetValue); + let dateObj = new Date(verNameGetValue); + if(verNameGetValue === undefined || verNameGetValue === null || verNameGetValue === '' || isNaN(dateObj.getDate())){ + throw new Error("Invalid time value"); + } // 年の設定(newYearが設定されていない場合は、元の値を使用) dateObj.setFullYear(this.props.newYear >=1900 && this.props.newYear <=9999 ? this.props.newYear : dateObj.getFullYear()); // 月の設定(newMonthが設定されていない場合は、元の値を使用)// 月は0始まりなので、12月は11。