Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle potential NPE #18966

Merged
merged 1 commit into from
Nov 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@ public class MetricTags {
public static final String WORKFLOW_TYPE = "workflow_type";
public static final String ATTEMPT_QUEUE = "attempt_queue";
public static final String GEOGRAPHY = "geography";
public static final String UNKNOWN = "unknown";

public static String getReleaseStage(final ReleaseStage stage) {
return stage.getLiteral();
return stage != null ? stage.getLiteral() : UNKNOWN;
}

public static String getFailureOrigin(final FailureOrigin origin) {
return origin.value();
return origin != null ? origin.value() : UNKNOWN;
}

public static String getJobStatus(final JobStatus status) {
return status.getLiteral();
return status != null ? status.getLiteral() : UNKNOWN;
}

}