[ios, osx] Fixed crash interacting with MGLOfflineTask

Added a missing conditional to the invalidation checking macro that I factored out at the last minute.
This commit is contained in:
Minh Nguyễn
2016-03-07 13:55:41 -08:00
committed by Minh Nguyễn
parent 8824237e2d
commit e218728f3a

View File

@@ -8,11 +8,15 @@
#include <mbgl/util/string.hpp>
#define MGLAssertOfflineTaskIsValid() \
[NSException raise:@"Invalid offline task" \
format: \
@"-[MGLOfflineStorage removeTask:withCompletionHandler:] has been called " \
@"on this instance of MGLOfflineTask, rendering it invalid. It is an " \
@"error to send any message to this task."]
do { \
if (_state == MGLOfflineTaskStateInvalid) { \
[NSException raise:@"Invalid offline task" \
format: \
@"-[MGLOfflineStorage removeTask:withCompletionHandler:] has been called " \
@"on this instance of MGLOfflineTask, rendering it invalid. It is an " \
@"error to send any message to this task."]; \
} \
} while (NO);
class MBGLOfflineRegionObserver;