mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
Don't crash when setting fish_history before reader is initialized
Not crashing is just soo much nicer. Fixes #4619.
This commit is contained in:
parent
585321181d
commit
75ac482cec
1 changed files with 5 additions and 2 deletions
|
@ -1962,8 +1962,11 @@ static parser_test_error_bits_t default_test(const wchar_t *b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void reader_change_history(const wchar_t *name) {
|
void reader_change_history(const wchar_t *name) {
|
||||||
data->history->save();
|
// We don't need to _change_ if we're not initialized yet.
|
||||||
data->history = &history_t::history_with_name(name);
|
if (data && data->history) {
|
||||||
|
data->history->save();
|
||||||
|
data->history = &history_t::history_with_name(name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void reader_push(const wchar_t *name) {
|
void reader_push(const wchar_t *name) {
|
||||||
|
|
Loading…
Reference in a new issue