# \[Bug report\] PCG runtime gen scheduler incorrectly detects editor viewport, leading to a crash when Play Credentials are set 

**URL:** <https://forums.unrealengine.com/t/bug-report-pcg-runtime-gen-scheduler-incorrectly-detects-editor-viewport-leading-to-a-crash-when-play-credentials-are-set/2730232>\
**Category:** Platform & Builds\
**Tags:** unreal-engine, Epic-Pro-Support, question\
**Created:** [May 6, 2026, 6:13pm UTC](https://forums.unrealengine.com/t/bug-report-pcg-runtime-gen-scheduler-incorrectly-detects-editor-viewport-leading-to-a-crash-when-play-credentials-are-set/2730232 "2026-05-06T18:13:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [May 6, 2026, 6:13pm UTC](https://forums.unrealengine.com/t/bug-report-pcg-runtime-gen-scheduler-incorrectly-detects-editor-viewport-leading-to-a-crash-when-play-credentials-are-set/2730232/1 "2026-05-06T18:13:17Z")

</div>

PCGRuntimeGenScheduler.cpp attempts to detect the editor viewport like so:

```auto
#if WITH_EDITOR
	// If we're in an editor world, stop updating preview if the editor window/viewport is not active (follows
	// same behaviour as other things).
	if (!World->IsGameWorld())
	{
		FViewport* Viewport = GEditor ? GEditor->GetActiveViewport() : nullptr;
		FEditorViewportClient* ViewportClient = Viewport ? static_cast<FEditorViewportClient*>(Viewport->GetClient()) : nullptr;

		if (!ViewportClient || !ViewportClient->IsVisible())
		{
			return false;
		}
	}
#endif

```

When the editor is signing into the OSS, and before the PIE window is actually created, calling GetClient on the viewport returns a client of type `CommonGameViewportClient` and not `EditorViewportClient`; the static cast is invalid. When the code then calls `IsVisible()`, it crashes because the underlying memory isn’t actually an `FEditorViewportClient`.

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [May 6, 2026, 6:13pm UTC](https://forums.unrealengine.com/t/bug-report-pcg-runtime-gen-scheduler-incorrectly-detects-editor-viewport-leading-to-a-crash-when-play-credentials-are-set/2730232/2 "2026-05-06T18:13:20Z")

</div>

**Steps to Reproduce**

- Set up a project with an online subsystem, and set up Play Credentials in editor preferences so that the editor will sign into the OSS before starting the PIE windows.
- Add an actor with a PCG component to the level - using the default PCG graph is fine.
- Observe a crash on line 370 of PCGRuntimeGenScheduler.cpp  
[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Julien\_LHeureux](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Julien\_LHeureux](https://forums.unrealengine.com/u/Julien_LHeureux)\
**Post date:** [May 14, 2026, 5:40pm UTC](https://forums.unrealengine.com/t/bug-report-pcg-runtime-gen-scheduler-incorrectly-detects-editor-viewport-leading-to-a-crash-when-play-credentials-are-set/2730232/3 "2026-05-14T17:40:38Z")

</div>

Hi June,

Thanks for reaching out. We weren’t aware of this and will have a look!

Cheers,

Julien

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Julien\_LHeureux](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Julien\_LHeureux](https://forums.unrealengine.com/u/Julien_LHeureux)\
**Post date:** [May 22, 2026, 8:37pm UTC](https://forums.unrealengine.com/t/bug-report-pcg-runtime-gen-scheduler-incorrectly-detects-editor-viewport-leading-to-a-crash-when-play-credentials-are-set/2730232/4 "2026-05-22T20:37:40Z")

</div>

Hi June!

We fixed it, and it will be in the next release (5.8). I’ll give you the change key when it’s available!

Cheers,

Julien

[Attachment Removed]
