Mario Danic hace 8 años
padre
commit
1effc4d23e

+ 25 - 0
src/generic/java/com/owncloud/android/utils/PushUtils.java

@@ -0,0 +1,25 @@
+/**
+ * Nextcloud Android client application
+ *
+ * @author Mario Danic
+ * Copyright (C) 2017 Mario Danic
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.owncloud.android.utils;
+
+public class PushUtils {
+    public static final String KEY_PUSH = "push";
+}

+ 2 - 1
src/main/java/com/owncloud/android/ui/activity/UserInfoActivity.java

@@ -358,7 +358,8 @@ public class UserInfoActivity extends FileActivity {
                                     String arbitraryDataPushString;
 
                                     if (!TextUtils.isEmpty(arbitraryDataPushString = arbitraryDataProvider.getValue(
-                                            account, PushUtils.KEY_PUSH))) {
+                                            account, PushUtils.KEY_PUSH)) &&
+                                            !TextUtils.isEmpty(getResources().getString(R.string.push_server_url))) {
                                         Gson gson = new Gson();
                                         PushArbitraryData pushArbitraryData = gson.fromJson(arbitraryDataPushString,
                                                 PushArbitraryData.class);