mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-24 11:29:16 +02:00
fcl-db: sdfdataset: fix seting null value to Field, Buffer=nil
git-svn-id: trunk@30532 -
This commit is contained in:
parent
c8f610282d
commit
b5bac61409
@ -631,10 +631,10 @@ begin
|
||||
TempPos := RecBuf;
|
||||
SetFieldPos(TRecordBuffer(RecBuf), Field.FieldNo);
|
||||
Result := (RecBuf < StrEnd(TempPos));
|
||||
if Result and (Buffer <> nil) then
|
||||
if Result and Assigned(Buffer) then
|
||||
begin
|
||||
StrLCopy(Buffer, RecBuf, Field.Size);
|
||||
if FTrimSpace then
|
||||
if FTrimSpace then // trim trailing spaces
|
||||
begin
|
||||
TempPos := StrEnd(Buffer);
|
||||
repeat
|
||||
@ -674,7 +674,7 @@ begin
|
||||
DatabaseErrorFmt(SReadOnlyField, [Field.DisplayName]);
|
||||
if State in [dsEdit, dsInsert, dsNewValue] then
|
||||
Field.Validate(Buffer);
|
||||
if Field.FieldKind <> fkInternalCalc then
|
||||
if Assigned(Buffer) and (Field.FieldKind <> fkInternalCalc) then
|
||||
begin
|
||||
SetFieldPos(TRecordBuffer(RecBuf), Field.FieldNo);
|
||||
BufEnd := StrEnd(pansichar(ActiveBuffer)); // Fill with blanks when necessary
|
||||
|
Loading…
Reference in New Issue
Block a user