From ce811ec063a5029604ec150ffe69c5829662bff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 15 Apr 2016 19:05:04 +0200 Subject: [PATCH] st: Don't assert when corner texture creation fails --- src/st/st-theme-node-drawing.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c index 6a47826d5..2d681b401 100644 --- a/src/st/st-theme-node-drawing.c +++ b/src/st/st-theme-node-drawing.c @@ -182,7 +182,6 @@ create_corner_material (StCornerSpec *corner) } g_free (data); - g_assert (texture != COGL_INVALID_HANDLE); return texture; } @@ -355,7 +354,7 @@ st_theme_node_lookup_corner (StThemeNode *node, float height, StCorner corner_id) { - CoglHandle texture, material; + CoglHandle texture, material = COGL_INVALID_HANDLE; char *key; StTextureCache *cache; StCornerSpec corner; @@ -404,8 +403,12 @@ st_theme_node_lookup_corner (StThemeNode *node, key = corner_to_string (&corner); texture = st_texture_cache_load (cache, key, ST_TEXTURE_CACHE_POLICY_NONE, load_corner, &corner, NULL); - material = _st_create_texture_pipeline (texture); - cogl_handle_unref (texture); + + if (texture) + { + material = _st_create_texture_pipeline (texture); + cogl_handle_unref (texture); + } g_free (key);