aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorArmin Weatherwax2011-04-26 19:59:54 +0200
committerArmin Weatherwax2011-05-17 07:48:14 +0200
commit9c41b8aa8ada35992fbcfdd71feb31653000dd99 (patch)
treed10f3fe15a7b78c0154c11e662583331b536b22e
parentescape special characters in settings.xml (diff)
downloadmeta-impy-9c41b8aa8ada35992fbcfdd71feb31653000dd99.zip
meta-impy-9c41b8aa8ada35992fbcfdd71feb31653000dd99.tar.gz
meta-impy-9c41b8aa8ada35992fbcfdd71feb31653000dd99.tar.bz2
meta-impy-9c41b8aa8ada35992fbcfdd71feb31653000dd99.tar.xz
Don't crash at the attempt to import clothing/bodyparts in file > import object
-rw-r--r--linden/indra/newview/primbackup.cpp20
1 files 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()
625 625
626void primbackup::import_object(bool upload) 626void primbackup::import_object(bool upload)
627{ 627{
628
629
628 textures.clear(); 630 textures.clear();
629 assetmap.clear(); 631 assetmap.clear();
630 current_asset=LLUUID::null; 632 current_asset=LLUUID::null;
@@ -641,9 +643,21 @@ void primbackup::import_object(bool upload)
641 std::string file_name = file_picker.getFirstFile().c_str(); 643 std::string file_name = file_picker.getFirstFile().c_str();
642 folder = gDirUtilp->getDirName(file_name); 644 folder = gDirUtilp->getDirName(file_name);
643 645
644 llifstream import_file(file_name); 646 {
645 LLSDSerialize::fromXML(llsd, import_file); 647 LLSD import_llsd;
646 import_file.close(); 648 llifstream import_file(file_name);
649 S32 status;
650 status = LLSDSerialize::fromXML(import_llsd, import_file);
651 import_file.close();
652
653 if (LLSDParser::PARSE_FAILURE == status)
654 {
655 llwarns << "invalid xml file." << llendl;
656 return;
657 }
658
659 llsd = import_llsd;
660 }
647 661
648 show(); 662 show();
649 663