ne0bot / delphionrails

Automatically exported from code.google.com/p/delphionrails
0 stars 0 forks source link

AV in dorSocketStub.pas, similar to r234 #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In dorSocketSub.pas, TCustomObserver.ProcessEvents, an AV can happen similar to 
the one fixed in r234, TCustomObserver.TEventProcessor.Run. Change suggestion:

  procedure TCustomObserver.ProcessEvents;
  var
    Events, Event: ISuperObject;
    proc: TEventProc;
  begin
    Events := ExtractEvents;
    if Events <> nil then
      for Event in Events do
        if ObjectIsType(Event, stObject) and ObjectIsType(Event.AsObject['event'], stString) then
        begin
          if FEventProc.TryGetValue(Event.S['event'], proc) then
            proc(Event);
        end else
          doOnInternalEvent(Event);
  end;

Checking Event for nil shouldn't be required as ObjectIsType should take care 
about this case.

Original issue reported on code.google.com by schnaade...@gmail.com on 11 Apr 2012 at 11:40

GoogleCodeExporter commented 8 years ago

Original comment by hgourv...@gmail.com on 13 Feb 2014 at 4:39