summaryrefslogtreecommitdiff
path: root/plugins/dexbnf/type.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/dexbnf/type.c')
-rw-r--r--plugins/dexbnf/type.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/dexbnf/type.c b/plugins/dexbnf/type.c
index 75d0b35..29ba0a8 100644
--- a/plugins/dexbnf/type.c
+++ b/plugins/dexbnf/type.c
@@ -203,14 +203,21 @@ static GDataType *dtd_field_type_descriptor(input_buffer *buffer, char ahead)
descriptor = dtd_non_array_field_type_descriptor(buffer, ahead);
- if (dim == 0)
- result = descriptor;
+ if (descriptor == NULL)
+ result = NULL;
else
{
- result = g_encapsulated_type_new(ECT_ARRAY, descriptor);
+ if (dim == 0)
+ result = descriptor;
+
+ else
+ {
+ result = g_encapsulated_type_new(ECT_ARRAY, descriptor);
- g_encapsulated_type_set_dimension(G_ENCAPSULATED_TYPE(result), dim);
+ g_encapsulated_type_set_dimension(G_ENCAPSULATED_TYPE(result), dim);
+
+ }
}