fix the error when adding new locations without any metadata

There was an error with adding new locations, whereas clicking on the submit button without first editing custom data (even if nothing was changed) would result in an empty string, which would not be JSON-parsable.