Skip to content

Commit

Permalink
Merge pull request #97 from ruslanskorb/patch-1
Browse files Browse the repository at this point in the history
[Fix] Import <UIKit/UIWebView.h> for iOS + App crash when no handler for message from JS.
  • Loading branch information
marcuswestin committed Aug 27, 2014
2 parents 362cf70 + 68a37a2 commit c8e4234
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions WebViewJavascriptBridge/WebViewJavascriptBridge.h
Expand Up @@ -17,6 +17,7 @@
#define WVJB_WEBVIEW_TYPE WebView
#define WVJB_WEBVIEW_DELEGATE_TYPE NSObject
#elif defined __IPHONE_OS_VERSION_MAX_ALLOWED
#import <UIKit/UIWebView.h>
#define WVJB_PLATFORM_IOS
#define WVJB_WEBVIEW_TYPE UIWebView
#define WVJB_WEBVIEW_DELEGATE_TYPE NSObject<UIWebViewDelegate>
Expand Down
4 changes: 4 additions & 0 deletions WebViewJavascriptBridge/WebViewJavascriptBridge.m
Expand Up @@ -196,6 +196,10 @@ - (void)_flushMessageQueue {
}
} else {
handler = _messageHandler;
if (!handler) {
NSLog(@"WVJB Warning: No handler for message from JS: %@", message);
return responseCallback(@{});
}
}

@try {
Expand Down

0 comments on commit c8e4234

Please sign in to comment.