Prevent the dialog from applying changes on bad input

Make sure the dialog does not change the json string if the
editor form contains any errors.

Change-Id: Ib4d36f70e1f9d5b34605b4e54fd12b6e2405c37a
Merge "Prevent the dialog from applying changes on bad input"