2
0
Эх сурвалжийг харах

* Do not raise exception unless needed

git-svn-id: trunk@38006 -
michael 8 жил өмнө
parent
commit
1ba38d5b87

+ 2 - 5
packages/fcl-res/src/groupresource.pp

@@ -86,11 +86,8 @@ begin
   fItemList:=TFPList.Create;
   //read NewHeader from resource
   RawData.Position:=0;
-  try
-    RawData.ReadBuffer(nh,sizeof(nh));
-  except
-    on e : EReadError do exit; //empty stream
-  end;
+  if RawData.Read(nh,sizeof(nh))<>nh then 
+    exit;
   {$IFDEF ENDIAN_BIG}
   nh.reserved:=SwapEndian(nh.reserved);
   nh.restype:=SwapEndian(nh.restype);