mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 02:07:39 +08:00
Android Bridge: Never send a response twice
Sometimes after responding with an error we would not stop, and also return with a sucess after.
This commit is contained in:
@ -199,6 +199,7 @@ public class MainActivity extends FlutterActivity implements MethodCallHandler {
|
|||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Log.d("getSSHPublicKey", ex.toString());
|
Log.d("getSSHPublicKey", ex.toString());
|
||||||
result.error("FAILED", "Failed to read the public key", null);
|
result.error("FAILED", "Failed to read the public key", null);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
result.success(publicKey);
|
result.success(publicKey);
|
||||||
@ -223,6 +224,7 @@ public class MainActivity extends FlutterActivity implements MethodCallHandler {
|
|||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Log.d("setSshKeys", ex.toString());
|
Log.d("setSshKeys", ex.toString());
|
||||||
result.error("FAILED", "Failed to write the ssh keys", null);
|
result.error("FAILED", "Failed to write the ssh keys", null);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
result.success(publicKey);
|
result.success(publicKey);
|
||||||
@ -235,9 +237,11 @@ public class MainActivity extends FlutterActivity implements MethodCallHandler {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
result.error("FAILED", e.toString(), null);
|
result.error("FAILED", e.toString(), null);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
result.success(filePath);
|
result.success(filePath);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
result.notImplemented();
|
result.notImplemented();
|
||||||
|
Reference in New Issue
Block a user