Browse Source

Fixed crash when debug output is not initialized.

Branimir Karadžić 10 years ago
parent
commit
aaea5f93ec
1 changed files with 7 additions and 5 deletions
  1. 7 5
      src/bgfx.cpp

+ 7 - 5
src/bgfx.cpp

@@ -339,11 +339,13 @@ namespace bgfx
 
 	void trace(const char* _filePath, uint16_t _line, const char* _format, ...)
 	{
-		va_list argList;
-		va_start(argList, _format);
-		g_callback->traceVargs(_filePath, _line, _format, argList);
-		va_end(argList);
-
+		if (NULL != g_callback)
+		{
+			va_list argList;
+			va_start(argList, _format);
+			g_callback->traceVargs(_filePath, _line, _format, argList);
+			va_end(argList);
+		}
 	}
 
 #include "charset.h"