Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
consul update: if value is not set it can be retrieved as null
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoslav committed Jan 16, 2017
1 parent c74466e commit b0d7c29
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -44,7 +44,8 @@ class ConsulStoreActor extends KeyValueStoreActor {
s"$url/v1/kv${KeyValueStoreActor.pathToString(path)}${if (keys) "?keys" else ""}"
}

private def result(map: Map[_, _]): String = {
map.asInstanceOf[Map[String, _]].get("Value").map(value Base64.getDecoder.decode(value.asInstanceOf[String])).map(new String(_)).getOrElse("")
private def result(map: Map[_, _]): String = map.asInstanceOf[Map[String, _]].get("Value") match {
case Some(value) if value != null new String(Base64.getDecoder.decode(value.asInstanceOf[String]))
case _ ""
}
}

0 comments on commit b0d7c29

Please sign in to comment.