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。