foxygit / doom Log in
commit e558fa3f2dd21d2870520c2449020ec7d5f3ca57
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Mon Sep 18 22:19:30 2006 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Mon Sep 18 22:19:30 2006 +0000

    Fix TXT_SelectWidgets with NULL spacers.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 615
---
 textscreen/txt_table.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/textscreen/txt_table.c b/textscreen/txt_table.c
index b6e8f29c..d1d0777e 100644
--- a/textscreen/txt_table.c
+++ b/textscreen/txt_table.c
@@ -577,6 +577,11 @@ int TXT_SelectWidget(TXT_UNCAST_ARG(table), TXT_UNCAST_ARG(widget))

     for (i=0; i<table->num_widgets; ++i)
     {
+        if (table->widgets[i] == NULL)
+        {
+            continue;
+        }
+
         if (table->widgets[i] == widget)
         {
             // Found the item!  Select it and return.