Fixed issue generating JSON with empty values.
This commit is contained in:
parent
35553cd9fc
commit
3edb0d4548
1 changed files with 15 additions and 1 deletions
16
ubuntuone.js
16
ubuntuone.js
|
@ -68,6 +68,11 @@ http.createServer(function(request, response)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
value = pieces[1];
|
value = pieces[1];
|
||||||
|
|
||||||
|
if (value == '')
|
||||||
|
{
|
||||||
|
value = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
line = '';
|
line = '';
|
||||||
|
@ -82,7 +87,16 @@ http.createServer(function(request, response)
|
||||||
payload += ',';
|
payload += ',';
|
||||||
}
|
}
|
||||||
|
|
||||||
payload += '"' + variable + '":"' + value + '"';
|
payload += '"' + variable + '":';
|
||||||
|
|
||||||
|
if (value == null)
|
||||||
|
{
|
||||||
|
payload += '""';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
payload += '"' + value + '"';
|
||||||
|
}
|
||||||
|
|
||||||
variable = '';
|
variable = '';
|
||||||
value = '';
|
value = '';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue