From cec5913c15743fdf0b94a5cef9fa0d1e47b3d9c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Wed, 1 Feb 2023 06:56:19 +0800 Subject: [PATCH] Handle invalid spec location --- signin.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/signin.js b/signin.js index c2013fd..00e7829 100644 --- a/signin.js +++ b/signin.js @@ -61,7 +61,6 @@ class Signin extends EventEmitter Start( action, params, handler ) { - var request = new HttpRequest( this.conf.spec ); var _self = this; if( this.spec ) @@ -70,6 +69,14 @@ class Signin extends EventEmitter } else { + if( !this.conf.spec ) + { + var eArgs = new SignInEventArgs({ "success": false, "data": [] }); + handler( this, eArgs ); + return; + } + + var request = new HttpRequest( this.conf.spec ); request.addListener( "RequestComplete", function( sender, e ) { if( e.statusCode == 200 )