From: terencehill Date: Wed, 7 Aug 2013 10:01:06 +0000 (+0200) Subject: Add sanity checks X-Git-Tag: xonotic-v0.8.0~139^2~1^2~155^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e38aec8c073dd39ac5b61fb70a87d6b922263d63;p=xonotic%2Fxonotic-data.pk3dir.git Add sanity checks --- diff --git a/qcsrc/menu/xonotic/screenshotlist.c b/qcsrc/menu/xonotic/screenshotlist.c index 8419eb709..49582e8cc 100644 --- a/qcsrc/menu/xonotic/screenshotlist.c +++ b/qcsrc/menu/xonotic/screenshotlist.c @@ -111,12 +111,14 @@ void XonoticScreenshotList_getScreenshots(entity me) getScreenshots_for_ext(me, ".tga", TRUE); getScreenshots_for_ext(me, ".png", TRUE); me.nItems = buf_getsize(me.listScreenshot); - buf_sort(me.listScreenshot, 128, FALSE); + if(me.nItems > 0) + buf_sort(me.listScreenshot, 128, FALSE); } void XonoticScreenshotList_destroy(entity me) { - buf_del(me.listScreenshot); + if(me.nItems > 0) + buf_del(me.listScreenshot); } void XonoticScreenshotList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)