# GetPropertyValue access violation

**URL:** <https://forums.unrealengine.com/t/getpropertyvalue-access-violation/382873>\
**Category:** C++\
**Tags:** properties, unreal-engine, question, CPP\
**Created:** [January 24, 2017, 10:40pm UTC](https://forums.unrealengine.com/t/getpropertyvalue-access-violation/382873 "2017-01-24T22:40:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nevermore](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nevermore](https://forums.unrealengine.com/u/Nevermore)\
**Post date:** [January 24, 2017, 10:40pm UTC](https://forums.unrealengine.com/t/getpropertyvalue-access-violation/382873/1 "2017-01-24T22:40:53Z")

</div>

when I try to get the property value the editor crashes with access violation, names of the properties themselves are read correctly

```
FText ULibFunctions::GetTextField(UObject* obj, FString name)
{
	for (TFieldIterator<UTextProperty> Prop(obj->GetClass()); Prop; ++Prop) {
		

		if (Prop->GetNameCPP() == name) {
			FText val = Prop->GetPropertyValue(obj);
			return val;
		}
	}
	return FText();

}
```

---

<div class="post-metadata">

**Author:** ![JohDav](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JohDav](https://forums.unrealengine.com/u/JohDav)\
**Post date:** [June 2, 2021, 3:10pm UTC](https://forums.unrealengine.com/t/getpropertyvalue-access-violation/382873/2 "2021-06-02T15:10:10Z")

</div>

Hi Nevermore, did you ever find out the reason for the access violation? Having the same issue.

---

<div class="post-metadata">

**Author:** ![JohDav](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JohDav](https://forums.unrealengine.com/u/JohDav)\
**Post date:** [June 2, 2021, 3:33pm UTC](https://forums.unrealengine.com/t/getpropertyvalue-access-violation/382873/3 "2021-06-02T15:33:05Z")

</div>

Found a solution. In my case using GetObjectPropertyValue\_InContainer instead did the trick and no more access violation.
