Permalink
Browse files

Show redbox when no bundle is present

Reviewed By: shergin

Differential Revision: D4405409

fbshipit-source-id: 847fc559121dcde844f1ee3c6d02206e9e27803b
  • Loading branch information...
javache authored and facebook-github-bot committed Jan 13, 2017
1 parent 09a83f9 commit a94418fdd3a5d6bb1ae2fa76737343bd1b76d864
Showing with 6 additions and 4 deletions.
  1. +4 −2 React/Base/RCTBatchedBridge.m
  2. +2 −2 React/Base/RCTLog.mm
@@ -192,9 +192,11 @@ - (void)loadSource:(RCTSourceLoadBlock)_onSourceLoad onProgress:(RCTSourceLoadPr
[self.delegate loadSourceForBridge:_parentBridge onProgress:onProgress onComplete:onSourceLoad];
} else if ([self.delegate respondsToSelector:@selector(loadSourceForBridge:withBlock:)]) {
[self.delegate loadSourceForBridge:_parentBridge withBlock:onSourceLoad];
+ } else if (!self.bundleURL) {
+ NSError *error = RCTErrorWithMessage(@"No bundle URL present.\n\nMake sure you're running a packager " \
+ "server or have included a .jsbundle file in your application bundle.");
+ onSourceLoad(error, nil, 0);
} else {
- RCTAssert(self.bundleURL, @"bundleURL must be non-nil when not implementing loadSourceForBridge");
-
[RCTJavaScriptLoader loadBundleAtURL:self.bundleURL onProgress:onProgress onComplete:^(NSError *error, NSData *source, int64_t sourceLength) {
if (error && [self.delegate respondsToSelector:@selector(fallbackSourceURLForBridge:)]) {
NSURL *fallbackURL = [self.delegate fallbackSourceURLForBridge:self->_parentBridge];
View
@@ -13,8 +13,8 @@
#include <cxxabi.h>
#import "RCTAssert.h"
-#import "RCTBridge.h"
#import "RCTBridge+Private.h"
+#import "RCTBridge.h"
#import "RCTDefines.h"
#import "RCTRedBox.h"
#import "RCTUtils.h"
@@ -229,7 +229,7 @@ void _RCTLogNativeInternal(RCTLogLevel level, const char *fileName, int lineNumb
}
NSRange range = NSMakeRange(0, frameSymbols.length);
- NSTextCheckingResult *match = [nativeStackFrameRegex() firstMatchInString:frameSymbols options:0 range:range];
+ NSTextCheckingResult *match = [nativeStackFrameRegex() firstMatchInString:frameSymbols options:0 range:range];
if (!match) {
return;
}

0 comments on commit a94418f

Please sign in to comment.