summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-10-29 16:09:42 -0400
committerKonstantin Käfer <mail@kkaefer.com>2014-10-30 11:58:16 -0400
commit7a13db9a863c9be58709e941f44eb2c370276e2a (patch)
treeb8c4b22c88cedd13bf0078ce04ec47f9f720947a /include
parent414ccaaf93fff1096086cd5c11acccc5cf5da7c3 (diff)
downloadqtlocation-mapboxgl-7a13db9a863c9be58709e941f44eb2c370276e2a.tar.gz
do not crash for missing images
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/util/image.hpp2
1 files changed, 1 insertions, 1 deletions
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<char[]> img;
-
};