summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 5eae2adf2e0..1e40c9fcfa8 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -1126,7 +1126,7 @@ Slice::Gen::TypesVisitor::visitDataMember(const DataMemberPtr& p)
{
string name = fixKwd(p->name());
TypePtr type = p->type();
- if(StructPtr::dynamicCast(p->container()) || ExceptionPtr::dynamicCast(p->container()) &&
+ if(p->container() != 0 && (StructPtr::dynamicCast(p->container()) || ExceptionPtr::dynamicCast(p->container())) &&
SequencePtr::dynamicCast(type))
{
SequencePtr s = SequencePtr::dynamicCast(type);