瀏覽代碼

* allow the buffer passed to Make() to be Nil

git-svn-id: trunk@36981 -
svenbarth 8 年之前
父節點
當前提交
0387df3228
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      packages/rtl-objpas/src/inc/rtti.pp

+ 2 - 0
packages/rtl-objpas/src/inc/rtti.pp

@@ -549,6 +549,8 @@ begin
   result.FData.FTypeInfo:=ATypeInfo;
   { resets the whole variant part; FValueData is already Nil }
   Result.FData.FAsUInt64 := 0;
+  if not Assigned(ABuffer) then
+    Exit;
   case ATypeInfo^.Kind of
     tkSString  : result.FData.FValueData := TValueDataIntImpl.CreateCopy(ABuffer, Length(PShortString(ABuffer)^) + 1, ATypeInfo, True);
     tkWString,