Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r--source/blender/editors/interface/interface.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 61e8fc38a04..aef20245676 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -2592,10 +2592,17 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
{
uiBut *but;
int slen;
-
- if (type & UI_BUT_POIN_TYPES) { /* a pointer is required */
- if (poin == NULL)
+
+ /* we could do some more error checks here */
+ if ((type & BUTTYPE) == LABEL) {
+ BLI_assert((poin != NULL || a1 != 0.0f || a2 != 0.0f || min != 0.0f || max != 0.0f) == FALSE);
+ }
+
+ if (type & UI_BUT_POIN_TYPES) { /* a pointer is required */
+ if (poin == NULL) {
+ BLI_assert(0);
return NULL;
+ }
}
but = MEM_callocN(sizeof(uiBut), "uiBut");