We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 930fd1a commit b80ff6bCopy full SHA for b80ff6b
src/main/java/com/airsaid/localization/translate/impl/openai/OpenAIResponse.java
@@ -75,11 +75,13 @@ public void setUsage(Usage usage) {
75
}
76
77
public String getTranslation() {
78
- return choices != null && !choices.isEmpty()
79
- ? choices.get(0).getMessage().getContent() != null
80
- ? choices.get(0).getMessage().getContent().trim()
81
- : ""
82
- : "";
+ if (choices != null && !choices.isEmpty()) {
+ String result = choices.get(0).getMessage().getContent();
+ return result.trim();
+
+ } else {
83
+ return "";
84
+ }
85
86
87
public static class Choice {
0 commit comments