Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #66 from atlanhq/chris
Browse files Browse the repository at this point in the history
Fix NPEs
  • Loading branch information
cmgrote authored Jul 17, 2023
2 parents a3bc4ff + a5a563d commit b1189cb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
GROUP=com.atlan
VERSION_NAME=1.3.0-SNAPSHOT
VERSION_NAME=1.2.1

POM_URL=https://github.com/atlanhq/atlan-java-samples
POM_SCM_URL=[email protected]:atlanhq/atlan-java-samples.git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ public abstract class AssetDetails {
String certificate = row.get(COL_CERTIFICATE);
String announcement = row.get(COL_ANNOUNCEMENT);

if (certificate.length() > 0) {
if (certificate != null && certificate.length() > 0) {
builder.certificate(CertificateStatus.fromValue(certificate));
}
if (announcement.length() > 0) {
if (announcement != null && announcement.length() > 0) {
builder.announcementType(AtlanAnnouncementType.fromValue(announcement));
}
return builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static ColumnDetails getFromRow(
String rawType = row.get(COL_COLUMN_TYPE);
String rawTypeOnly = DataTypeMapper.getTypeOnly(rawType);
String mappedType = DataTypeMapper.getMappedType(rawTypeOnly);
if (rawType.length() > 0) {
if (rawType != null && rawType.length() > 0) {
builder = builder.rawType(rawType);
}
if (mappedType != null && mappedType.length() > 0) {
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/atlan/samples/reporters/UserReporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class UserReporter extends AbstractReporter implements RequestHandler<Map

private static final Set<String> autoSizeSheets = new HashSet<>();

private static final Comparator<String> stringComparator = Comparator.nullsFirst(String::compareTo);

public static void main(String[] args) {
UserReporter ur = new UserReporter();
Map<String, String> event = new HashMap<>(System.getenv());
Expand All @@ -55,7 +57,8 @@ public String handleRequest(Map<String, String> event, Context context) {
log.info("Retrieving user details for tenant: {}", Atlan.getBaseUrlSafe());
List<AtlanUser> users;
users = AtlanUser.retrieveAll();
users.sort(Comparator.comparing(AtlanUser::getFirstName).thenComparing(AtlanUser::getLastName));
users.sort(Comparator.comparing(AtlanUser::getFirstName, stringComparator)
.thenComparing(AtlanUser::getLastName, stringComparator));

log.info("Creating Excel file (in-memory)...");
if (context != null && context.getClientContext() != null) {
Expand Down

0 comments on commit b1189cb

Please sign in to comment.