From 9a060b2d23c19de3130434ed78db38d49b9ef4ab Mon Sep 17 00:00:00 2001 From: inoussa Date: Thu, 13 Aug 2015 15:14:26 +0000 Subject: [PATCH] Fix Binary Format optional object read failing. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4268 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- wst/trunk/base_binary_formatter.pas | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wst/trunk/base_binary_formatter.pas b/wst/trunk/base_binary_formatter.pas index a68057f27..856f5f6bd 100644 --- a/wst/trunk/base_binary_formatter.pas +++ b/wst/trunk/base_binary_formatter.pas @@ -1459,11 +1459,12 @@ var begin stk := StackTop(); locNode := stk.Find(AScopeName); - if not Assigned(locNode) then begin - Error(SERR_ScopeNotFound,[AScopeName]); + if (locNode <> nil) then begin + PushStack(locNode,stObject); + Result := StackTop().GetItemCount(); + end else begin + Result := -1; end; - PushStack(locNode,stObject); - Result := StackTop().GetItemCount(); end; function TBaseBinaryFormatter.BeginArrayRead(