repositories
/
lsystem3d.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7cd25ed
)
* Check for missing attribute
author
spixx
<spixx>
Sat, 11 Nov 2006 13:15:43 +0000
(13:15 +0000)
committer
spixx
<spixx>
Sat, 11 Nov 2006 13:15:43 +0000
(13:15 +0000)
src/xmlstructure.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/xmlstructure.cpp
b/src/xmlstructure.cpp
index f2832c3a86f02ca19150cb01be944ab4a1618a81..278f270cf2513e0bbaeb6c3cd33a5dfd0125fbb3 100644
(file)
--- a/
src/xmlstructure.cpp
+++ b/
src/xmlstructure.cpp
@@
-1,6
+1,6
@@
// Copyright (C) 2006 Erik Dahlberg
//
// Copyright (C) 2006 Erik Dahlberg
//
-// This file is part of LSystem3
d
.
+// This file is part of LSystem3
D
.
//
// LSystem3D is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
//
// LSystem3D is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@
-21,6
+21,7
@@
#include <string>
#include <string>
+#include <libxml++/attribute.h>
#include <libxml++/document.h>
#include <libxml++/nodes/element.h>
#include <libxml++/nodes/node.h>
#include <libxml++/document.h>
#include <libxml++/nodes/element.h>
#include <libxml++/nodes/node.h>
@@
-225,7
+226,13
@@
string XMLStructure::getAttribute(string name)
xmlpp::Element *child = dynamic_cast<xmlpp::Element*>(*_activeChildInList);
// its attribute value
xmlpp::Element *child = dynamic_cast<xmlpp::Element*>(*_activeChildInList);
// its attribute value
- string attributeValue = child->get_attribute(name)->get_value();
+ string attributeValue;
+ xmlpp::Attribute *attribute = child->get_attribute(name);
+
+ if (attribute)
+ {
+ attributeValue = attribute->get_value();
+ }
return attributeValue;
}
return attributeValue;
}