summaryrefslogtreecommitdiff
path: root/src/if_py_both.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r--src/if_py_both.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h
index aa2591267..cbfbaa767 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -77,6 +77,11 @@ OutputWrite(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
return NULL;
+ /* TODO: This works around a gcc optimizer problem and avoids Vim
+ * from crashing. Should find a real solution. */
+ if (str == NULL)
+ return NULL;
+
Py_BEGIN_ALLOW_THREADS
Python_Lock_Vim();
writer((writefn)(error ? emsg : msg), (char_u *)str, len);