From 0ea55320cee10673660e7a4a328c4e0124429a4e Mon Sep 17 00:00:00 2001 From: Jakub Kubrynski Date: Wed, 28 Jan 2015 21:48:09 +0100 Subject: [PATCH] Fixed #3 Having empty String breaks JSON parsing --- .../io/coderate/accurest/util/StubMappingConverter.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accurest-core/src/main/groovy/io/coderate/accurest/util/StubMappingConverter.groovy b/accurest-core/src/main/groovy/io/coderate/accurest/util/StubMappingConverter.groovy index ee2528c7c6..439224eccd 100644 --- a/accurest-core/src/main/groovy/io/coderate/accurest/util/StubMappingConverter.groovy +++ b/accurest-core/src/main/groovy/io/coderate/accurest/util/StubMappingConverter.groovy @@ -28,9 +28,9 @@ class StubMappingConverter { } static def transformValue(def value, Closure closure) { - if (value instanceof String) { + if (value instanceof String && value) { try { - def json = new JsonSlurper().parseText(value as String) + def json = new JsonSlurper().parseText(value) if (json instanceof Map) { return convertPlaceholders(json, closure) }