diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-10-29 16:09:42 -0400 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-10-30 11:58:16 -0400 |
commit | 7a13db9a863c9be58709e941f44eb2c370276e2a (patch) | |
tree | b8c4b22c88cedd13bf0078ce04ec47f9f720947a /include | |
parent | 414ccaaf93fff1096086cd5c11acccc5cf5da7c3 (diff) | |
download | qtlocation-mapboxgl-7a13db9a863c9be58709e941f44eb2c370276e2a.tar.gz |
do not crash for missing images
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/util/image.hpp | 2 |
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; - }; |