Commit 88e4356b390950d167a39a17865d34c6a37858c4
1 parent
a1e300f3
Exists in
master
and in
5 other branches
Fix JSON.parse bug on software block JS
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
public/mpog-download-block.js
| @@ -15,9 +15,9 @@ | @@ -15,9 +15,9 @@ | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | function get_download_list_template() { | 17 | function get_download_list_template() { |
| 18 | - var blockTemplate = JSON.parse(sessionStorage.getItem('download_list_block_template')); | 18 | + var blockTemplate = sessionStorage.getItem('download_list_block_template'); |
| 19 | 19 | ||
| 20 | - if(blockTemplate) { | 20 | + if(blockTemplate && blockTemplate.length > 0) { |
| 21 | window.download_list_template = blockTemplate; | 21 | window.download_list_template = blockTemplate; |
| 22 | } else { | 22 | } else { |
| 23 | $.get('/plugin/software_communities/get_block_template', function(response) { | 23 | $.get('/plugin/software_communities/get_block_template', function(response) { |