diff --git a/src/main/java/com/flowingcode/vaadin/addons/demo/MultiSourceCodeViewer.java b/src/main/java/com/flowingcode/vaadin/addons/demo/MultiSourceCodeViewer.java index 471dbef..45c139b 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/demo/MultiSourceCodeViewer.java +++ b/src/main/java/com/flowingcode/vaadin/addons/demo/MultiSourceCodeViewer.java @@ -136,7 +136,7 @@ public SourcePosition getSourcePosition() { private Optional findTabWithFilename(String filename) { if (tabs != null) { - return tabs.getChildren().filter(Tab.class::isInstance).map(Tab.class::cast).filter(tab -> { + return tabs.getTabs().filter(tab -> { String url = (String) ComponentUtil.getData(tab, DATA_URL); return filename == null || getFilename(url).equals(filename); }).findFirst();