ovsdb-doc: Put NAME section into generated manpage.
[sliver-openvswitch.git] / lib / table.c
index 86366d0..537fae9 100644 (file)
@@ -23,6 +23,7 @@
 #include "dynamic-string.h"
 #include "json.h"
 #include "ovsdb-data.h"
+#include "ovsdb-error.h"
 #include "util.h"
 
 struct column {
@@ -54,6 +55,7 @@ cell_to_text(struct cell *cell, const struct table_style *style)
                     cell->text = ds_steal_cstr(&s);
                 } else {
                     cell->text = json_to_string(cell->json, JSSF_SORT);
+                    ovsdb_error_destroy(error);
                 }
             }
         } else {
@@ -478,8 +480,10 @@ table_print_json__(const struct table *table, const struct table_style *style)
             const struct cell *cell = table_cell__(table, y, x);
             if (cell->text) {
                 json_array_add(row, json_string_create(cell->text));
-            } else {
+            } else if (cell->json) {
                 json_array_add(row, json_clone(cell->json));
+            } else {
+                json_array_add(row, json_null_create());
             }
         }
         json_array_add(data, row);