diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 1b3fd5d49beb71560fd8b6d9b9c4a0a1423d9572..085d6d47e588740f286b5f507018efa458c610d8 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -519,6 +519,11 @@ void LLViewerMedia::buildMediaManagerData( LLMediaManagerData* init_data )
 	component_dir += gDirUtilp->getDirDelimiter();
   #ifdef LL_DEBUG
 	component_dir += "mozilla_debug";
+	// *NOTE:Mani - if this doesn't exist llmozlib goes crashy in the debug build.
+	// LLMozlib::init wants to write some files to <exe_dir>/components
+	std::string debug_init_component_dir( gDirUtilp->getExecutableDir() );
+	debug_init_component_dir += "/components";
+	LLAPRFile::makeDir(debug_init_component_dir.c_str()); 
   #else // LL_DEBUG
 	component_dir += "mozilla";
   #endif // LL_DEBUG