Check if window is null before displaying the warning message (Vaadin has a weird behavior on valuechange)

Issue: GCP-9412

Reviewer: Jaira