From e977d1d312a5d3bbdaa404cd6f010ebf303dbd0b Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Wed, 15 Jan 2020 10:16:13 -0800 Subject: [PATCH] Fix crash when escaping command_documentation --- custom/4coder_docs.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/custom/4coder_docs.cpp b/custom/4coder_docs.cpp index 99a3e237..c3262b8e 100644 --- a/custom/4coder_docs.cpp +++ b/custom/4coder_docs.cpp @@ -195,8 +195,10 @@ CUSTOM_DOC("Prompts the user to select a command then loads a doc buffer for tha Scratch_Block scratch(app); Doc_Cluster *docs = doc_commands(scratch); Doc_Page *page = get_doc_page_from_user(app, docs, "Doc Page:"); - Buffer_ID buffer = render_doc_page(app, page); - view_set_buffer(app, view, buffer, 0); + if (page != 0){ + Buffer_ID buffer = render_doc_page(app, page); + view_set_buffer(app, view, buffer, 0); + } } }