Browse Source

Restore needed null check in OS_Unix::execute()

Pedro J. Estébanez 4 years ago
parent
commit
76d5ab8b9a
1 changed files with 6 additions and 2 deletions
  1. 6 2
      drivers/unix/os_unix.cpp

+ 6 - 2
drivers/unix/os_unix.cpp

@@ -298,9 +298,13 @@ Error OS_Unix::execute(const String &p_path, const List<String> &p_arguments, bo
 
 
 		while (fgets(buf, 65535, f)) {
 		while (fgets(buf, 65535, f)) {
 
 
-			p_pipe_mutex->lock();
+			if (p_pipe_mutex) {
+				p_pipe_mutex->lock();
+			}
 			(*r_pipe) += String::utf8(buf);
 			(*r_pipe) += String::utf8(buf);
-			p_pipe_mutex->unlock();
+			if (p_pipe_mutex) {
+				p_pipe_mutex->unlock();
+			}
 		}
 		}
 		int rv = pclose(f);
 		int rv = pclose(f);
 		if (r_exitcode)
 		if (r_exitcode)