From 9c41b8aa8ada35992fbcfdd71feb31653000dd99 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Tue, 26 Apr 2011 19:59:54 +0200 Subject: Don't crash at the attempt to import clothing/bodyparts in file > import object --- linden/indra/newview/primbackup.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/linden/indra/newview/primbackup.cpp b/linden/indra/newview/primbackup.cpp index 7f050a0..613000a 100644 --- a/linden/indra/newview/primbackup.cpp +++ b/linden/indra/newview/primbackup.cpp @@ -625,6 +625,8 @@ void primbackup::export_next_texture() void primbackup::import_object(bool upload) { + + textures.clear(); assetmap.clear(); current_asset=LLUUID::null; @@ -641,9 +643,21 @@ void primbackup::import_object(bool upload) std::string file_name = file_picker.getFirstFile().c_str(); folder = gDirUtilp->getDirName(file_name); - llifstream import_file(file_name); - LLSDSerialize::fromXML(llsd, import_file); - import_file.close(); + { + LLSD import_llsd; + llifstream import_file(file_name); + S32 status; + status = LLSDSerialize::fromXML(import_llsd, import_file); + import_file.close(); + + if (LLSDParser::PARSE_FAILURE == status) + { + llwarns << "invalid xml file." << llendl; + return; + } + + llsd = import_llsd; + } show(); -- cgit v1.1