From 7a13db9a863c9be58709e941f44eb2c370276e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Wed, 29 Oct 2014 16:09:42 -0400 Subject: do not crash for missing images --- include/mbgl/util/image.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/mbgl/util/image.hpp b/include/mbgl/util/image.hpp index 0bc5af21d2..cb7db6d6fc 100644 --- a/include/mbgl/util/image.hpp +++ b/include/mbgl/util/image.hpp @@ -17,6 +17,7 @@ public: inline const char *getData() const { return img.get(); } inline uint32_t getWidth() const { return width; } inline uint32_t getHeight() const { return height; } + inline operator bool() const { return img && width && height; } private: // loaded image dimensions @@ -24,7 +25,6 @@ private: // the raw image data std::unique_ptr img; - }; -- cgit v1.2.1