aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/option.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 9b31e14ea7..69c12e2cc7 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -1054,13 +1054,15 @@ void set_init_3(void)
*/
void set_helplang_default(const char *lang)
{
- int idx;
+ if (lang == NULL) {
+ return;
+ }
const size_t lang_len = strlen(lang);
- if (lang == NULL || lang_len < 2) { // safety check
+ if (lang_len < 2) { // safety check
return;
}
- idx = findoption("hlg");
+ int idx = findoption("hlg");
if (idx >= 0 && !(options[idx].flags & P_WAS_SET)) {
if (options[idx].flags & P_ALLOCED)
free_string_option(p_hlg);