Index: trunk/psLib/src/fits/psFitsTableNew.c
===================================================================
--- trunk/psLib/src/fits/psFitsTableNew.c	(revision 32361)
+++ trunk/psLib/src/fits/psFitsTableNew.c	(revision 32409)
@@ -117,5 +117,6 @@
 
 psFitsTable* psFitsTableAlloc(int numCols, int numRows) {
-    if (numCols <= 0) {
+    if (numCols < 0) {
+        // empty table
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
                 "Can't allocate a psFitsTable with %d columns.", numCols);
@@ -127,6 +128,10 @@
     table->numRows = numRows;
     table->numCols = numCols;
-    table->columns = psAlloc(sizeof(psFitsTableColumn) * numCols);
-    memset(table->columns, sizeof(psFitsTableColumn) * numCols, 0);
+    if (numCols > 0) {
+        table->columns = psAlloc(sizeof(psFitsTableColumn) * numCols);
+        memset(table->columns, sizeof(psFitsTableColumn) * numCols, 0);
+    } else {
+        table->columns = NULL;
+    }
     psMemSetDeallocator(table, (psFreeFunc) freeTable);
 
@@ -141,5 +146,6 @@
     if (!readTableCheck(fits)) {
         if (emptyTableCheck(fits)) {
-            return NULL;
+            psFitsTable *table = psFitsTableAlloc(0, 0);
+            return table;
         }
         psError(PS_ERR_BAD_FITS, true, "Extension is not a table");
