tests: add sanity check on insn->detail, since it can be NULL when SKIPDATA option is ON
diff --git a/tests/test_mips.c b/tests/test_mips.c
index fb6ea96..fcbefa1 100644
--- a/tests/test_mips.c
+++ b/tests/test_mips.c
@@ -31,8 +31,13 @@
 
 static void print_insn_detail(cs_insn *ins)
 {
-	cs_mips *mips = &(ins->detail->mips);
+	cs_mips *mips;
 
+	// detail can be NULL on "data" instruction if SKIPDATA option is turned ON
+	if (ins->detail == NULL)
+		return;
+
+	mips = &(ins->detail->mips);
 	if (mips->op_count)
 		printf("\top_count: %u\n", mips->op_count);