Browse Source

Display error message instead of mysterious crash when encountering unknown BamObjectCode

rdb 10 years ago
parent
commit
f152c238d5
1 changed files with 5 additions and 0 deletions
  1. 5 0
      panda/src/putil/bamReader.cxx

+ 5 - 0
panda/src/putil/bamReader.cxx

@@ -1214,6 +1214,11 @@ p_read_object() {
     }
     }
 
 
     return p_read_object();
     return p_read_object();
+
+  default:
+    bam_cat.error()
+      << "Encountered invalid BamObjectCode 0x" << hex << (int)boc << dec << ".\n";
+    return 0;
   }
   }
 
 
   // An object definition in a Bam file consists of a TypeHandle
   // An object definition in a Bam file consists of a TypeHandle