浏览代码

Raise exception if no scanner specified

git-svn-id: trunk@25617 -
michael 12 年之前
父节点
当前提交
38f72cf39b
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      packages/fcl-json/src/jsonparser.pp

+ 3 - 0
packages/fcl-json/src/jsonparser.pp

@@ -67,12 +67,15 @@ Resourcestring
   SErrExpectedElementName    = 'Expected element name, got token "%s"';
   SExpectedCommaorBraceClose = 'Expected , or ], got token "%s".';
   SErrInvalidNumber          = 'Number is not an integer or real number: %s';
+  SErrNoScanner = 'No scanner. No source specified ?';
   
 { TJSONParser }
 
 Function TJSONParser.Parse : TJSONData;
 
 begin
+  if (FScanner=Nil) then
+    DoError(SErrNoScanner);
   Result:=DoParse(False,True);
 end;