Index: trunk/tools/repair_bad_instance
===================================================================
--- trunk/tools/repair_bad_instance	(revision 33197)
+++ trunk/tools/repair_bad_instance	(revision 33924)
@@ -123,5 +123,10 @@
         return 0;
     }
+    if (! ($nextend =~ /\d+/)) {
+        print "failed to find NEXTEND for $file. command returned $nextend\n";
+        return 0;
+    }
     print "\t$file: $nextend extensions\n";
+
 
     $command = 'fhead -x ' . ($nextend - 1) . " $file | grep EXTNAME | awk '{print \$3}'";
