View Issue Details

IDProjectCategoryView StatusLast Update
0001640JEDI VCL00 JVCL Componentspublic2004-04-15 10:05
ReporteranonymousAssigned Touser72 
PrioritynormalSeveritycrashReproducibilitysometimes
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001640: TJvDBGrid 1.44 crash in CanEditShow (access violation)
Descriptioncrash on the line:
    F := Fields[SelectedIndex];

to be protected I modify the function to the following version:
function TJvDBGrid.CanEditShow: Boolean;
var
  F: TField;
begin
  Result := inherited CanEditShow;
{ F := nil;
  if Result and (DataLink <> nil) and DataLink.Active and (FieldCount > 0) and
    (SelectedIndex < FieldCount) and (SelectedIndex >= 0) and
    (FieldCount <= DataSource.DataSet.FieldCount) then
  begin
    F := Fields[SelectedIndex];
    if F <> nil then
      Result := GetImageIndex(F) < 0;
  end;
  }
  if Result and Assigned(FOnShowEditor) and (DataLink <> nil) and DataLink.Active and (FieldCount > 0) and (SelectedIndex < FieldCount) and (SelectedIndex >= 0) and
    (FieldCount <= DataSource.DataSet.FieldCount) then
  begin
     F := Fields[SelectedIndex];
     FOnShowEditor(Self, F, Result);
  end;
end;
Additional InformationCrash appends when the dataset used by the dbGrid is modified or replaced.
TagsNo tags attached.

Activities

user72

2004-04-15 10:05

  ~0003878

Thanks. Fixed in CVS (v 1.46)

Issue History

Date Modified Username Field Change
2004-04-15 02:38 anonymous New Issue
2004-04-15 10:05 user72 Status new => resolved
2004-04-15 10:05 user72 Resolution open => fixed
2004-04-15 10:05 user72 Assigned To => user72
2004-04-15 10:05 user72 Note Added: 0003878