Unverified Commit 744755f3 authored by Mahesh Kumar Gangula's avatar Mahesh Kumar Gangula Committed by GitHub
Browse files

Merge pull request #809 from project-sunbird/release-4.7.0

Issue #SB-29374 merge: From release-4.7.0 to release-4.8.0
Showing with 4 additions and 3 deletions
+4 -3
......@@ -453,8 +453,9 @@ object HierarchyManager {
responseFuture.map(response => {
if (!ResponseHandler.checkError(response)) {
val relationalMetadataString = response.getResult.toMap.getOrDefault("relational_metadata", "").asInstanceOf[String]
if (StringUtils.isNotEmpty(relationalMetadataString)) {
Future(JsonUtils.deserialize(relationalMetadataString, classOf[java.util.Map[String, AnyRef]]).toMap)
if (StringUtils.isNotEmpty(relationalMetadataString) && !relationalMetadataString.trim.isBlank) {
val relMetadataJavaMap = JsonUtils.deserialize(relationalMetadataString, classOf[java.util.Map[String, AnyRef]])
if(relMetadataJavaMap != null && relMetadataJavaMap.size()>0) Future(relMetadataJavaMap.toMap) else Future(Map[String, AnyRef]())
} else
Future(Map[String, AnyRef]())
} else {
......@@ -464,7 +465,7 @@ object HierarchyManager {
responseFuture.map(response => {
if (!ResponseHandler.checkError(response)) {
val relationalMetadataString = response.getResult.toMap.getOrDefault("relational_metadata", "").asInstanceOf[String]
if (StringUtils.isNotEmpty(relationalMetadataString)) {
if (StringUtils.isNotEmpty(relationalMetadataString) && !relationalMetadataString.trim.isBlank) {
Future(JsonUtils.deserialize(relationalMetadataString, classOf[java.util.Map[String, AnyRef]]).toMap)
} else
Future(Map[String, AnyRef]())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment