# HG changeset patch # User Christian Brabandt # Date 1488489304 -3600 # Node ID 50f3e37bc2108c8dc7badea8f3615d59c0184352 # Parent 05daa23e1ecf158401ed45476954147dc3122389 patch 8.0.0399: crash when using balloon_show() when not supported commit https://github.com/vim/vim/commit/caf6434ac937cf26050276d7b474be2d2d6a06b3 Author: Bram Moolenaar Date: Thu Mar 2 22:11:33 2017 +0100 patch 8.0.0399: crash when using balloon_show() when not supported Problem: Crash when using balloon_show() when not supported. (Hirohito Higashi) Solution: Check for balloonEval not to be NULL. (Ken Takata) diff --git a/src/evalfunc.c b/src/evalfunc.c --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -1375,7 +1375,8 @@ f_atan2(typval_T *argvars, typval_T *ret static void f_balloon_show(typval_T *argvars, typval_T *rettv UNUSED) { - gui_mch_post_balloon(balloonEval, get_tv_string_chk(&argvars[0])); + if (balloonEval != NULL) + gui_mch_post_balloon(balloonEval, get_tv_string_chk(&argvars[0])); } #endif diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -466,3 +466,8 @@ func Test_getbufvar() set fileformats& endfunc + +func Test_balloon_show() + " This won't do anything but must not crash either. + call balloon_show('hi!') +endfunc diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 399, +/**/ 398, /**/ 397,