OSDN Git Service

Supress RegExp Error when the script is empty
authornaru <bottle@mikage.to>
Sun, 24 Aug 2003 19:25:27 +0000 (19:25 +0000)
committernaru <bottle@mikage.to>
Sun, 24 Aug 2003 19:25:27 +0000 (19:25 +0000)
bottleclient/BottleChainRule.pas

index a7ca11f..0972c11 100755 (executable)
@@ -1318,7 +1318,10 @@ begin
   if not (Event is TBottleChainBottleEvent) then Exit;
   Dat := (Event as TBottleChainBottleEvent).Data;
   try
-    Result := RegExp.Match(Pattern, Dat['Script']);
+    if Dat['Script'] <> '' then
+      Result := RegExp.Match(Pattern, Dat['Script'])
+    else
+      Result := false;
   except
     on E: EBRegExpError do begin
       ShowMessage('\90³\8bK\95\\8c»\83G\83\89\81['#13#10#13#10 + E.Message);