Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit d9ecfc85 authored by Tobias Kaminsky's avatar Tobias Kaminsky Committed by GitHub
Browse files

Merge pull request #235 from desperateCoder/231-void-return-type

fix file uploads vor networkRequests V2
parents ee86900a 7d0b95eb
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -133,11 +133,14 @@ public class NextcloudAPI {
             Reader targetReader = new InputStreamReader(os)) {
            if (targetEntity != Void.class) {
                result = gson.fromJson(targetReader, targetEntity);
                /*
                if (result != null) {
                    Log.d(TAG, result.toString());
                if (result == null) {
                    if (targetEntity == Object.class) {
                        return (T) NOTHING;
                    } else {
                        throw new IllegalStateException("Could not instantiate \"" +
                                targetEntity.toString() + "\", because response was null.");
                    }
                }
                */
            } else {
                result = (T) NOTHING;
            }
@@ -165,7 +168,7 @@ public class NextcloudAPI {
     * @throws Exception or SSOException
     */
    public Response performNetworkRequestV2(NextcloudRequest request) throws Exception {
        return networkRequest.performNetworkRequestV2(request, null);
        return networkRequest.performNetworkRequestV2(request, request.getBodyAsStream());
    }

    protected Gson getGson() {