Skip to content

Commit 9728639

Browse files
xiaocangclaude
andcommitted
Fix compile error: move continue outside withContext lambda
Return null from withContext on network error and continue at the outer loop level, since Kotlin disallows break/continue across function boundaries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 06a136a commit 9728639

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

android/app/src/main/kotlin/com/ghpr/app/auth/GitHubOAuthManager.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class GitHubOAuthManager(context: Context) {
170170
.post(body)
171171
.build()
172172

173-
val payload = withContext(Dispatchers.IO) {
173+
val payload: String? = withContext(Dispatchers.IO) {
174174
try {
175175
client.newCall(request).execute().use { response ->
176176
val raw = response.body?.string().orEmpty()
@@ -188,10 +188,12 @@ class GitHubOAuthManager(context: Context) {
188188
pollingError = e.message ?: "Network error",
189189
)
190190
}
191-
continue
191+
null
192192
}
193193
}
194194

195+
if (payload == null) continue
196+
195197
// Clear polling error on successful response
196198
val current = _authState.value
197199
if (current is GitHubAuthState.Authenticating && current.pollingError != null) {

0 commit comments

Comments
 (0)