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

Commit 7d0b95eb authored by desperateCoder's avatar desperateCoder
Browse files

improved null handling

parent 48b6c052
Loading
Loading
Loading
Loading
+7 −4
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;
            }