diff options
author | Wilson E. Alvarez <wilson.e.alvarez1@gmail.com> | 2017-08-25 11:14:33 -0400 |
---|---|---|
committer | Wilson E. Alvarez <wilson.e.alvarez1@gmail.com> | 2017-08-26 16:58:47 -0400 |
commit | 7a07895920196c00d1ee14187e4ccdb2a6f0d0b9 (patch) | |
tree | d8acd6c8d53717c3a4ec205b000ac8f0ff1fc985 /scene | |
parent | 53c0010932f9c1becb63c16243f3a00ede359989 (diff) |
Added/Fixed null pointer checks
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/text_edit.cpp | 4 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 2 |
2 files changed, 3 insertions, 3 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); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 20bf818d44..f4e1bff9af 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2868,8 +2868,8 @@ TreeItem *Tree::create_item(TreeItem *p_parent) { TreeItem *ti = memnew(TreeItem(this)); - ti->cells.resize(columns.size()); ERR_FAIL_COND_V(!ti, NULL); + ti->cells.resize(columns.size()); if (p_parent) { |