diff --git a/ruby/engine/measure_manager_server.rb b/ruby/engine/measure_manager_server.rb index 336c1db868..6bc56ac5fa 100644 --- a/ruby/engine/measure_manager_server.rb +++ b/ruby/engine/measure_manager_server.rb @@ -119,7 +119,7 @@ def do_POST (request, response) result = {} - data = JSON.parse(request.body, {:symbolize_names=>true}) + data = JSON.parse(request.body || "{}", {:symbolize_names=>true}) my_measures_dir = data[:my_measures_dir] if my_measures_dir @@ -132,7 +132,7 @@ def do_POST (request, response) result = [] - data = JSON.parse(request.body, {:symbolize_names=>true}) + data = JSON.parse(request.body || "{}", {:symbolize_names=>true}) uid = data[:uid] if uid @@ -156,8 +156,8 @@ def do_POST (request, response) result = [] - data = JSON.parse(request.body, {:symbolize_names=>true}) force_reload = false + data = JSON.parse(request.body || "{}", {:symbolize_names=>true}) # loop over all local BCL measures OpenStudio::LocalBCL.instance.measures.each do |local_measure| @@ -181,7 +181,7 @@ def do_POST (request, response) result = [] - data = JSON.parse(request.body, {:symbolize_names=>true}) + data = JSON.parse(request.body || "{}", {:symbolize_names=>true}) measures_dir = data[:measures_dir] ? data[:measures_dir] : @my_measures_dir force_reload = data[:force_reload] ? data[:force_reload] : false @@ -205,7 +205,7 @@ def do_POST (request, response) when "/compute_arguments" - data = JSON.parse(request.body, {:symbolize_names=>true}) + data = JSON.parse(request.body || "{}", {:symbolize_names=>true}) measure_dir = data[:measure_dir ] osm_path = data[:osm_path] force_reload = data[:force_reload] ? data[:force_reload] : false @@ -239,7 +239,7 @@ def do_POST (request, response) when "/create_measure" - data = JSON.parse(request.body, {:symbolize_names=>true}) + data = JSON.parse(request.body || "{}", {:symbolize_names=>true}) measure_dir = data[:measure_dir] # name = data[:name] # we do not take name as input @@ -263,7 +263,7 @@ def do_POST (request, response) when "/duplicate_measure" - data = JSON.parse(request.body, {:symbolize_names=>true}) + data = JSON.parse(request.body || "{}", {:symbolize_names=>true}) old_measure_dir = data[:old_measure_dir] measure_dir = data[:measure_dir]