Page MenuHomeFeedback Tracker

Calling GetWorkspace after reloading Workbench layout file returns null
Assigned, UrgentPublic

Description

Calling this code here from a ScriptClass within the Workbench will cause it to crash AFTER reloading (first load works fine)

Details

Severity
Block
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General
Steps To Reproduce
  1. Create Script file with the following code within the constructor:

Note: Any layout file will work, I just chose this one for example

GetGame().GetWorkspace().CreateWidgets("gui/layouts/dialog.layout");
  1. Call Script file from ANY ScriptClass on a layout file
  2. Reload layout data (this can be done by just changing a paramenter in a Widget - example Toggle Visibility)

  1. Crash workbench! Because GetGame().GetWorkspace() returned null :)
Additional Information

I've included the two files I used to reproduce this bug. Below is my result, notice workspace = NULL

Event Timeline

Geez changed the task status from New to Assigned.Aug 18 2020, 10:15 AM