diff --git a/modules/desktop/src/com/haulmont/cuba/desktop/sys/DesktopTimeSource.java b/modules/desktop/src/com/haulmont/cuba/desktop/sys/DesktopTimeSource.java index a41064527d..0e22e6126d 100644 --- a/modules/desktop/src/com/haulmont/cuba/desktop/sys/DesktopTimeSource.java +++ b/modules/desktop/src/com/haulmont/cuba/desktop/sys/DesktopTimeSource.java @@ -39,7 +39,9 @@ public class DesktopTimeSource implements TimeSource, ConnectionListener { protected ServerInfoService serverInfo; public DesktopTimeSource() { - App.getInstance().getConnection().addListener(this); + App app = App.getInstance(); + if (app != null) // can be null in tests + app.getConnection().addListener(this); } @Inject