From 85939e5a1b694b8ee50bfd7702a9af81eb0eee1a Mon Sep 17 00:00:00 2001 From: bigbiff Date: Sat, 15 Nov 2014 21:03:52 -0500 Subject: Thanks to _that, return null if vector is empty Change-Id: Idc44455dd0c971c876ae283528c4367a82e145bd --- gui/resources.cpp | 1 - gui/resources.hpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/gui/resources.cpp b/gui/resources.cpp index 4fce0ca44..5f3923d10 100644 --- a/gui/resources.cpp +++ b/gui/resources.cpp @@ -247,7 +247,6 @@ void ResourceManager::LoadResources(xml_node<>* resList, ZipArchive* pZip) if (!resList) return; - child = resList->first_node("resource"); while (child != NULL) { diff --git a/gui/resources.hpp b/gui/resources.hpp index 3cb528176..54a1185c3 100644 --- a/gui/resources.hpp +++ b/gui/resources.hpp @@ -77,8 +77,8 @@ public: virtual ~AnimationResource(); public: - virtual void* GetResource(void) { return mSurfaces.at(0); } - virtual void* GetResource(int entry) { return mSurfaces.at(entry); } + virtual void* GetResource(void) { return mSurfaces.empty() ? NULL : mSurfaces.at(0); } + virtual void* GetResource(int entry) { return mSurfaces.empty() ? NULL : mSurfaces.at(entry); } virtual int GetResourceCount(void) { return mSurfaces.size(); } protected: -- cgit v1.2.3