diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2006-09-12 15:52:04 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2006-09-12 15:52:04 +0000 |
commit | 35574b10c487fdf174dca6a0fc1e746698454880 (patch) | |
tree | 19c2d59aad85a42d2552534166eb2ae5c1986854 /src/perl/common/Settings.xs | |
parent | b25c8cf1d14b31890e44fbb5b239ff5f8867b394 (diff) | |
download | irssi-35574b10c487fdf174dca6a0fc1e746698454880.zip |
Do not crash when settings_get_str returns NULL.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4341 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/perl/common/Settings.xs')
-rw-r--r-- | src/perl/common/Settings.xs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/perl/common/Settings.xs b/src/perl/common/Settings.xs index 624f1102..378e0c59 100644 --- a/src/perl/common/Settings.xs +++ b/src/perl/common/Settings.xs @@ -72,8 +72,14 @@ SV * settings_get_str(key) char *key CODE: - RETVAL = newSVpv(settings_get_str(key), 0); - SvUTF8_on(RETVAL); + const char *str; + + RETVAL = NULL; + str = settings_get_str(key); + if (str != NULL) { + RETVAL = newSVpv(str, 0); + SvUTF8_on(RETVAL); + } OUTPUT: RETVAL |