Fix segmentation fault when top==NULL

Introduced by nested class handling (reported in issue#346 by Paweł Tomulik).
This commit is contained in:
Olly Betts 2015-02-26 14:56:29 +13:00
commit de1cae9319
2 changed files with 8 additions and 0 deletions

View file

@ -340,6 +340,8 @@ static void insertNodeAfter(Node *n, Node *c) {
}
void Swig_nested_name_unnamed_c_structs(Node *n) {
if (!n)
return;
if (!classhash)
classhash = Getattr(n, "classes");
Node *c = firstChild(n);
@ -427,6 +429,8 @@ static void remove_outer_class_reference(Node *n) {
}
void Swig_nested_process_classes(Node *n) {
if (!n)
return;
Node *c = firstChild(n);
while (c) {
Node *next = nextSibling(c);