diff options
author | Sam Tuke <samtuke@owncloud.com> | 2012-09-18 16:51:55 +0100 |
---|---|---|
committer | Sam Tuke <samtuke@owncloud.com> | 2012-09-18 16:55:03 +0100 |
commit | 9df403f051354b24da61b12f6446d10d899f05f7 (patch) | |
tree | a05b04dacef9e78497a77945e28ce83f0e578be4 /lib | |
parent | 842cd57fa780029e60d0fb8094d4dd794bb33cb7 (diff) | |
download | nextcloud-server-9df403f051354b24da61b12f6446d10d899f05f7.tar.gz nextcloud-server-9df403f051354b24da61b12f6446d10d899f05f7.zip |
Added failsafes for retrieving remote apps on settings->apps page, in case categories or app data are not found
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/app.php | 17 | ||||
-rw-r--r-- | lib/ocsclient.php | 2 |
2 files changed, 16 insertions, 3 deletions
diff --git a/lib/app.php b/lib/app.php index 328095a90d2..38ba4bcdc88 100755 --- a/lib/app.php +++ b/lib/app.php @@ -563,7 +563,12 @@ class OC_App{ if ( is_array( $catagoryNames ) ) { - $categories = array_keys( $catagoryNames ); + // Check that categories of apps were retrieved correctly + if ( ! $categories = array_keys( $catagoryNames ) ) { + + return false; + + } $page = 0; @@ -589,7 +594,15 @@ class OC_App{ } - return $app1; + if ( empty( $app1 ) ) { + + return false; + + } else { + + return $app1; + + } } /** diff --git a/lib/ocsclient.php b/lib/ocsclient.php index 8596ea0b3c7..6428a883679 100644 --- a/lib/ocsclient.php +++ b/lib/ocsclient.php @@ -53,7 +53,7 @@ class OC_OCSClient{ /** * @brief Get all the categories from the OCS server * @returns array with category ids - * + * @note returns NULL if config value appstoreenabled is set to false * This function returns a list of all the application categories on the OCS server */ public static function getCategories() { |