Skip to content

[Improvement] Fix potential null pointer expections in CLI #6528

Open
@justinmclean

Description

@justinmclean

What would you like to be improved?

There are several places with potential a NPE could occur. While these are unlikely to occur, we should still add checks.

In CatalogAudit.java:
displayAuditInfo(result.auditInfo());

In CreateTable.java:
client.loadCatalog(catalog).asTableCatalog().createTable(tableName, columns, comment, null);

in ListCatalogProperties.java:
Map<String, String> properties = gCatalog.properties();

In ListColumns.java:
for (int i = 0; i < columns.length; i++) {

In ListFilesetProperties.java:
Map<String, String> properties = gFileset.properties();

In ListMetalakeProperties.java:
Map<String, String> properties = gMetalake.properties();

In ListSchemaProperties.java:
Map<String, String> properties = gSchema.properties();

In ListTableProperties.java:
Map<String, String> properties = gTable.properties();

In ListTables.java:
if (tables.length == 0) {

In ListTagProperties.java:
Map<String, String> properties = gTag.properties();

In ListTopicProperties.java:
Map<String, String> properties = gTopic.properties();

In ModelDetails.java:
String.format("Model name %s, latest version: %s%n", gModel.name(), gModel.latestVersion());

In SchemaAudit.java:
displayAuditInfo(result.auditInfo());

In TableAudit.java:
displayAuditInfo(gTable.auditInfo());

In TableDistribution.java:
printInformation(distribution.strategy() + "," + distribution.number());

In TopicDetails.java:
printResults(gTopic.name() + "," + gTopic.comment());

In UserDetails.java:
if (roles.isEmpty()) {

How should we improve?

Add appropriate null checks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions