Skip to content

Commit 63672a0

Browse files
committed
[lists] some improvements
1 parent d131343 commit 63672a0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Quick.Lists.pas

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{ ***************************************************************************
22
3-
Copyright (c) 2016-2019 Kike Pérez
3+
Copyright (c) 2016-2020 Kike Pérez
44
55
Unit : Quick.Lists
66
Description : Generic Lists functions
77
Author : Kike Pérez
88
Version : 1.2
99
Created : 04/11/2018
10-
Modified : 11/05/2019
10+
Modified : 12/03/2020
1111
1212
This file is part of QuickLib: https://github.com/exilon/QuickLib
1313
@@ -257,11 +257,11 @@ function TSearchObjectList<T>.Get(const aFieldName: string; const aValue: string
257257
begin
258258
if aClassField = TClassField.cfField then
259259
begin
260-
if TRTTI.GetFieldValue(TObject(val),aFieldName).AsString = aValue then Exit(val);
260+
if (val <> nil) and (TRTTI.GetFieldValue(TObject(val),aFieldName).AsString = aValue) then Exit(val);
261261
end
262262
else
263263
begin
264-
if GetStrProp(TObject(val),aFieldName) = aValue then Exit(val);
264+
if (val <> nil) and (GetStrProp(TObject(val),aFieldName) = aValue) then Exit(val);
265265
end;
266266
end;
267267
end;

0 commit comments

Comments
 (0)