Fix Parent Page not found for null (ID: 0, parent_id: 0)

This commit is contained in:
Alejandro 2019-07-21 20:35:00 +03:00
parent b9b77d3515
commit bda19d759f
2 changed files with 21 additions and 13 deletions

View File

@ -283,9 +283,7 @@ public class CatalogManager {
Emulator.getLogging().logSQLException(e); Emulator.getLogging().logSQLException(e);
} }
pages.forEachValue(new TObjectProcedure<CatalogPage>() { pages.forEachValue((object) -> {
@Override
public boolean execute(CatalogPage object) {
CatalogPage page = pages.get(object.parentId); CatalogPage page = pages.get(object.parentId);
if (page != null) { if (page != null) {
@ -298,7 +296,6 @@ public class CatalogManager {
} }
} }
return true; return true;
}
}); });
this.catalogPages.putAll(pages); this.catalogPages.putAll(pages);

View File

@ -9,6 +9,17 @@ import java.sql.SQLException;
public class CatalogRootLayout extends CatalogPage { public class CatalogRootLayout extends CatalogPage {
public CatalogRootLayout() { public CatalogRootLayout() {
super(); super();
this.id = -1;
this.parentId = -2;
this.rank = 0;
this.caption = "root";
this.pageName = "root";
this.iconColor = 0;
this.iconImage = 0;
this.orderNum = -10;
this.visible = true;
this.enabled = true;
} }
public CatalogRootLayout(ResultSet set) throws SQLException { public CatalogRootLayout(ResultSet set) throws SQLException {