ID 502066 - hiero.ui.getTimelineEditor returns an object, even when the Timeline Editor for that sequence is closed

Follow

Problem summary
hiero.ui.getTimelineEditor returns an object, even when the Timeline Editor for that sequence is closed

The developer documentation says that it should return None, if no appropriate editor is found:
https://learn.foundry.com/hiero/developers/latest/HieroPythonDevGuide/api/api_ui.html?highlight=gettimelineedi#hiero.ui.getTimelineEditor

Customer reported version
hiero.n/a

Customer reported platform
Linux, CentOS 7

Steps to reproduce

1) Open Hiero/Nuke Studio

2) Create two sequences in the bin. Right Click>New>New Sequence x 2

3) Double click one of the sequences to open it in the timeline editor

4) In the Script Editor, run the following code:

for sequence in hiero.core.projects()[0].sequences():
print(hiero.ui.getTimelineEditor(sequence))

Expected behaviour
getTimelineEditor should return a ui.Hiero.Python.TimelineEditor object for the open sequence, and None for the other sequence

Actual behaviour
getTimelineEditor returns ui.Hiero.Python.TimelineEditor object sequences which have never been opened, or ones which have been closed

Workaround
check the if ui.Hiero.Python.TimelineEditor.window() is visible, and if not, return None:
for sequence in hiero.core.projects()[0].sequences():
timelineEditor = hiero.ui.getTimelineEditor(sequence)
if timelineEditor.window().isVisible():
print (timelineEditor)
else:
print (None)

Reproduced by support
This bug has been reproduced in:
Nuke Studio 13.1v2 - Windows 10, CentOS 7, macOS Big Sur
Nuke Studio 12.0v1 - Windows 10
Nuke Studio 9.0v1 - Windows 10, macOS Big Sur

Earliest version tested
Nuke Studio 9.0v1 - This issue appears to be in all versions of the product

    We're sorry to hear that

    Please tell us why