Browse Source

Raise exception if no scanner specified

git-svn-id: trunk@25617 -
michael 12 years ago
parent
commit
38f72cf39b
1 changed files with 3 additions and 0 deletions
  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;