Pārlūkot izejas kodu

System types like the string doesn't have a module information. Now the function is checking if is loaded to not raise any error.

Henrique Gottardi Werlang 5 mēneši atpakaļ
vecāks
revīzija
a9f23105b4
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 4 1
      packages/rtl/src/rtti.pas

+ 4 - 1
packages/rtl/src/rtti.pas

@@ -2473,7 +2473,10 @@ end;
 
 function TRttiType.GetDeclaringUnitName: String;
 begin
-  Result := Handle.Module.Name;
+  if Assigned(Handle.Module) then
+    Result := Handle.Module.Name
+  else
+    Result := 'System';
 end;
 
 function TRttiType.GetQualifiedName: String;