# \[BUG\] Function with Blueprint argument error after editor restart

**URL:** <https://forums.unrealengine.com/t/bug-function-with-blueprint-argument-error-after-editor-restart/320790>\
**Category:** Blueprint\
**Tags:** unreal-engine, bug-report, editor, question, Blueprint, CPP\
**Created:** [June 5, 2015, 11:40am UTC](https://forums.unrealengine.com/t/bug-function-with-blueprint-argument-error-after-editor-restart/320790 "2015-06-05T11:40:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexOteiza](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlexOteiza](https://forums.unrealengine.com/u/AlexOteiza)\
**Post date:** [June 5, 2015, 11:40am UTC](https://forums.unrealengine.com/t/bug-function-with-blueprint-argument-error-after-editor-restart/320790/1 "2015-06-05T11:40:24Z")

</div>

With a UFunction that takes a UBlueprint\* as argument when the editor is restarted, the parameter becomes invalid.

Bug procedure:

1: Create and implement UFunction inside an Actor class like this:

```
UFUNCTION(BlueprintCallable, Category = "Test")
void TestBlueprint(UBlueprint* blueprint);

```

2: In the editor create a blueprint that extends from the previous class

3: Create a node calling the previous TestBlueprint function and in “Blueprint” select any other blueprint asset, it compiles without any problems and everything works perfectly:

 ![45377-bugpic1111111.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/a/5/0a548679c5befc01fc6d6583755d1d15f26ec6a5.png)

4: Save all and restart the Unreal Editor, then reopen the blueprint:

 ![45378-bugpic1111112.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/c/c/0ccbabe40a002b94a8ea05df91f7b4620c38502f.png)

This raises an error stating that the specified blueprint is invalid, in order to solve it you have to reassign again the value manually EVERY time the editor is restarted.

---

<div class="post-metadata">

**Author:** ![2rusbekov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@2rusbekov](https://forums.unrealengine.com/u/2rusbekov)\
**Post date:** [June 5, 2015, 11:56am UTC](https://forums.unrealengine.com/t/bug-function-with-blueprint-argument-error-after-editor-restart/320790/2 "2015-06-05T11:56:15Z")

</div>

> in order to solve it you have to reassign again the value manually EVERY time the editor is restarted.

You can recompile blueprint EVERY time the editor is restarted.  
It won’t resolve the issue, but it’s faster then reassigning value))

---

<div class="post-metadata">

**Author:** ![AlexOteiza](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlexOteiza](https://forums.unrealengine.com/u/AlexOteiza)\
**Post date:** [June 6, 2015, 12:12am UTC](https://forums.unrealengine.com/t/bug-function-with-blueprint-argument-error-after-editor-restart/320790/3 "2015-06-06T00:12:24Z")

</div>

@  
Thanks for the comment, but recompiling doesn’t fix the issue, the blueprint is unable to compile, it displays the error “Blueprint pin is invalid”. The only way I could make it work is by reassigning.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [June 8, 2015, 5:28pm UTC](https://forums.unrealengine.com/t/bug-function-with-blueprint-argument-error-after-editor-restart/320790/4 "2015-06-08T17:28:13Z")

</div>

Hey

I was able to reproduce and bug the error you described when restarting the editor (UE-16682). For now the easiest workaround seems to be reassigning the value as you mentioned.

Cheers

---

<div class="post-metadata">

**Author:** ![AlexOteiza](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlexOteiza](https://forums.unrealengine.com/u/AlexOteiza)\
**Post date:** [July 7, 2015, 9:27am UTC](https://forums.unrealengine.com/t/bug-function-with-blueprint-argument-error-after-editor-restart/320790/5 "2015-07-07T09:27:04Z")

</div>

If anyone is interested, I have found out a workaround to this problem. I changed the function declaration to this:

`void TestBlueprint(UObject* blueprint);`

And then in the code I cast to `UBlueprintGeneratedClass*`  
that way there are no blueprint reference problems
