Browse Source

check to see if s.builder is nil

Michael Kutowski 1 year ago
parent
commit
3d90e580c5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/text/edit/text_edit.odin

+ 1 - 1
core/text/edit/text_edit.odin

@@ -124,7 +124,7 @@ setup_once :: proc(s: ^State, builder: ^strings.Builder) {
 // returns true when the builder had content to be cleared
 // clear builder&selection and the undo|redo stacks
 clear_all :: proc(s: ^State) -> (cleared: bool) {
-	if len(s.builder.buf) > 0 {
+	if s.builder != nil && len(s.builder.buf) > 0 {
 		clear(&s.builder.buf)
 		s.selection = {}
 		cleared = true