mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Autocorrect invalid JSON for flag importing
This commit is contained in:
parent
951252d8fe
commit
7759ab1212
@ -245,7 +245,14 @@ namespace Bloxstrap.UI.Elements.Menu.Pages
|
||||
if (dialog.Result != MessageBoxResult.OK)
|
||||
return;
|
||||
|
||||
json = dialog.JsonTextBox.Text;
|
||||
json = dialog.JsonTextBox.Text.Trim();
|
||||
|
||||
// autocorrect where possible
|
||||
if (!json.StartsWith('{'))
|
||||
json = '{' + json;
|
||||
|
||||
if (!json.EndsWith('}'))
|
||||
json += '}';
|
||||
|
||||
try
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user