How to check if viewport is active?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By devolonter

Hi,

When I try to call VisualServer.viewport_set_active(get_viewport_rid(), true) I’ve got error message in console (not crash):

viewport_set_active: Condition "active_viewports.find(viewport) != -1"is true.

It happens because viewport is already active. So how I can check that viewport is active or how I can hide this error message?