Skip to content

Commit b80ff6b

Browse files
rbenzaAirsaid
authored andcommitted
Trim whitespace
1 parent 930fd1a commit b80ff6b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main/java/com/airsaid/localization/translate/impl/openai/OpenAIResponse.java

+7-5
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@ public void setUsage(Usage usage) {
7575
}
7676

7777
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-
: "";
78+
if (choices != null && !choices.isEmpty()) {
79+
String result = choices.get(0).getMessage().getContent();
80+
return result.trim();
81+
82+
} else {
83+
return "";
84+
}
8385
}
8486

8587
public static class Choice {

0 commit comments

Comments
 (0)