From e3f231ff2a4967a53a00a6b7611840db2c55fe1f Mon Sep 17 00:00:00 2001 From: tomaioo Date: Sat, 23 May 2026 05:22:09 -0700 Subject: [PATCH] fix(security): missing error handler in gulp watch task The gulp.watch task does not include error handling. If the 'less' task fails during watch mode, the watch process may crash or hang without clear indication, potentially leaving the build in an inconsistent state. Additionally, the callback `cb()` is called immediately after gulp.watch, not waiting for the watch to actually start or handle errors. Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com> --- gulpfile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 2e873ced..7fca571c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,8 +15,8 @@ gulp.task('less', function (cb) { gulp.task( 'default', - gulp.series('less', function (cb) { - gulp.watch('styles/**/*.less', gulp.series('less')); - cb(); + gulp.series('less', function () { + return gulp.watch('styles/**/*.less', gulp.series('less')) + .on('error', console.error.bind(console)); }) );