summaryrefslogtreecommitdiff
path: root/scene/gui/text_edit.cpp
diff options
context:
space:
mode:
authorWilson E. Alvarez <wilson.e.alvarez1@gmail.com>2017-08-25 11:14:33 -0400
committerWilson E. Alvarez <wilson.e.alvarez1@gmail.com>2017-08-26 16:58:47 -0400
commit7a07895920196c00d1ee14187e4ccdb2a6f0d0b9 (patch)
treed8acd6c8d53717c3a4ec205b000ac8f0ff1fc985 /scene/gui/text_edit.cpp
parent53c0010932f9c1becb63c16243f3a00ede359989 (diff)
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 2c50b4e854..6e7d1eb8a9 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);