Browse Source

allow dump with no data

ncannasse 6 years ago
parent
commit
20a0eefb9d
1 changed files with 9 additions and 1 deletions
  1. 9 1
      hxd/fmt/hmd/Dump.hx

+ 9 - 1
hxd/fmt/hmd/Dump.hx

@@ -35,7 +35,10 @@ class Dump {
 		add('HMD v${h.version}');
 		prefix = "\t";
 		add("Header : " + hxd.Math.fmt(h.dataPosition/1024) + " KB");
-		add("Data : " + hxd.Math.fmt(h.data.length / 1024) + " KB");
+		if( h.data == null )
+			add("No Data");
+		else
+			add("Data : " + hxd.Math.fmt(h.data.length / 1024) + " KB");
 		addProps(h.props);
 		prefix = "";
 		add("");
@@ -155,6 +158,11 @@ class Dump {
 
 		if( h.animations.length > 0 ) add("");
 
+		if( h.data == null ) {
+			add("DONE");
+			return buf.toString();
+		}
+
 		// ---- DUMP DATA ----
 
 		var d = new haxe.io.BytesInput(h.data);