Skip to content

Instantly share code, notes, and snippets.

@chillu
Created March 28, 2013 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chillu/f8bbe0a87f3feab8946d to your computer and use it in GitHub Desktop.
Save chillu/f8bbe0a87f3feab8946d to your computer and use it in GitHub Desktop.
diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php
index 9cc8c53..b9f8828 100644
--- a/admin/code/LeftAndMain.php
+++ b/admin/code/LeftAndMain.php
@@ -1413,7 +1413,11 @@ class LeftAndMain extends Controller implements PermissionProvider {
$cache = SS_Cache::factory('LeftAndMain_CMSVersion');
$cacheKey = filemtime($composerLockPath);
$versions = $cache->load($cacheKey);
- if(!$versions) $versions = array();
+ if($versions) {
+ $versions = json_decode($versions);
+ } else {
+ $versions = array();
+ }
if(!$versions && $jsonData = file_get_contents($composerLockPath)) {
$lockData = json_decode($jsonData);
if($lockData && isset($lockData->packages)) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment