1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-15 00:24:19 +00:00

Fix for JSON stringification of INF and NaN double values

This commit is contained in:
jules 2018-10-09 16:51:11 +01:00
parent 77634bc802
commit d5034083cb

View file

@ -348,7 +348,12 @@ struct JSONFormatter
}
else if (v.isDouble())
{
out << String (static_cast<double> (v), maximumDecimalPlaces);
auto d = static_cast<double> (v);
if (juce_isfinite (d))
out << String (d, maximumDecimalPlaces);
else
out << "null";
}
else if (v.isArray())
{