summaryrefslogtreecommitdiff
path: root/scene/gui/text_edit.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-08-27 02:10:56 +0200
committerGitHub <noreply@github.com>2017-08-27 02:10:56 +0200
commit612099e3771578fd3e78171f1ca1444f6c41cef3 (patch)
treec4173d550b3148c1223f67de0a8836dc744e831a /scene/gui/text_edit.cpp
parentea55b400d908c01345a974cae82d8a8720e9904d (diff)
parent7a07895920196c00d1ee14187e4ccdb2a6f0d0b9 (diff)
Merge pull request #10591 from Rubonnek/possible-null-ptr-dereference
Added/Fixed null pointer checks
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r--scene/gui/text_edit.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index e506953d77..a5de50af99 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -215,8 +215,8 @@ void TextEdit::Text::_update_line_cache(int p_line) const {
const Map<int, TextEdit::Text::ColorRegionInfo> &TextEdit::Text::get_color_region_info(int p_line) {
- Map<int, ColorRegionInfo> *cri = NULL;
- ERR_FAIL_INDEX_V(p_line, text.size(), *cri); //enjoy your crash
+ static Map<int, ColorRegionInfo> cri;
+ ERR_FAIL_INDEX_V(p_line, text.size(), cri);
if (text[p_line].width_cache == -1) {
_update_line_cache(p_line);