Merge "Fail call log code generation if method had zero matching outputs."
diff --git a/scripts/opengl/gen_call_log_wrapper.py b/scripts/opengl/gen_call_log_wrapper.py
index 9fee311..b6ea95e 100644
--- a/scripts/opengl/gen_call_log_wrapper.py
+++ b/scripts/opengl/gen_call_log_wrapper.py
@@ -415,10 +415,15 @@
 				printouts += "\t\tm_log << TestLog::Message << \"// %s = \" << %s << TestLog::EndMessage;\n" % (param.name, logSpec.argOutPrints[paramNdx](param.name))
 				numPrintouts += 1
 
-		if numPrintouts > 1:
+		# If print handlers do not match the actual command, that is very likely an error. Check
+		# print handlers is a subset of all arguments.
+		if numPrintouts == 0 or len(set(logSpec.argOutPrints.keys()) - set(range(len(command.params)))) > 0:
+			raise Exception("Invalid print handlers when processing command %s" % command.name)
+
+		if numPrintouts != 1:
 			src += "\t{\n"
 		src += printouts
-		if numPrintouts > 1:
+		if numPrintouts != 1:
 			src += "\t}\n"
 
 	if not isVoid: