Skip to content

Commit

Permalink
check if database fields are not null
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioG70 committed Nov 11, 2024
1 parent c7c77f0 commit 1ab6ef7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected void configureDisplay(CellTable<ViewerDatabase> display) {
Column<ViewerDatabase, SafeHtml> nameColumn = new TooltipColumn<ViewerDatabase>() {
@Override
public SafeHtml getValue(ViewerDatabase database) {
return database != null && database.getMetadata() != null
return database != null && database.getMetadata() != null && database.getMetadata().getName() != null
? SafeHtmlUtils.fromString(database.getMetadata().getName())
: SafeHtmlUtils.fromString("unknown");
}
Expand All @@ -95,7 +95,7 @@ public SafeHtml getValue(ViewerDatabase database) {
Column<ViewerDatabase, SafeHtml> dbmsColumn = new TooltipColumn<ViewerDatabase>() {
@Override
public SafeHtml getValue(ViewerDatabase database) {
return database != null && database.getMetadata() != null
return database != null && database.getMetadata() != null && database.getMetadata().getDatabaseProduct() != null
? SafeHtmlUtils.fromString(database.getMetadata().getDatabaseProduct())
: SafeHtmlUtils.fromString("unknown");
}
Expand All @@ -114,6 +114,7 @@ public SafeHtml getValue(ViewerDatabase database) {
@Override
public SafeHtml getValue(ViewerDatabase database) {
return database != null && database.getMetadata() != null
&& database.getMetadata().getArchivalDate() != null
? SafeHtmlUtils.fromString(database.getMetadata().getArchivalDate().substring(0, 10))
: null;
}
Expand Down

0 comments on commit 1ab6ef7

Please sign in to comment.