summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-05-14 22:44:43 +0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-05-19 09:30:14 +0200
commit9ccef311aae891daf4436e6d89117bfae3d95959 (patch)
treeb7c6d583c13b7e3438b8383b4fcad6b64935a483
parent86cac77fc143b85452c22b2ca06810696a0d15ed (diff)
Do not throw if there is no "images" child in json file tree.
Change-Id: I0b47ed00fecad84859ba3f1751407696878203fb
-rw-r--r--avmedia/source/framework/modeltools.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/avmedia/source/framework/modeltools.cxx b/avmedia/source/framework/modeltools.cxx
index ea400a3182e2..9b485529a19c 100644
--- a/avmedia/source/framework/modeltools.cxx
+++ b/avmedia/source/framework/modeltools.cxx
@@ -71,7 +71,7 @@ static void lcl_EmbedExternals(const OUString& rSourceURL, uno::Reference<embed:
// Parse json, read externals' URI and modify this relative URI's so they remain valid in the new context.
std::vector<std::string> vExternals;
- ptree aTree;
+ ptree aTree, aEmptyTree;
try
{
json_parser::read_json( sUrl, aTree );
@@ -85,7 +85,7 @@ static void lcl_EmbedExternals(const OUString& rSourceURL, uno::Reference<embed:
aTree.put("buffers." + rVal.first + ".path.",sBufferUri.substr(sBufferUri.find_last_of('/')+1));
}
// Images for textures
- BOOST_FOREACH(ptree::value_type &rVal,aTree.get_child("images"))
+ BOOST_FOREACH(ptree::value_type &rVal,aTree.get_child("images", aEmptyTree))
{
const std::string sImageUri(rVal.second.get<std::string>("path"));
vExternals.push_back(sImageUri);