Skip to content

Commit 9df79e7

Browse files
pakoitofacebook-github-bot
authored andcommitted
Inspector crashes when a device name contained spaces
Reviewed By: Hypuk Differential Revision: D5434498 fbshipit-source-id: f758497ca50e4c02e436812725acfe0dcb8428b4
1 parent e5e9cab commit 9df79e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

React/DevSupport/RCTInspectorDevServerHelper.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@
3030

3131
static NSURL *getInspectorDeviceUrl(NSURL *bundleURL)
3232
{
33+
NSString *escapedText = [[[UIDevice currentDevice] name] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
3334
return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/inspector/device?name=%@",
3435
getDebugServerHost(bundleURL),
35-
[[UIDevice currentDevice] name]]];
36+
escapedText]];
3637
}
3738

3839

0 commit comments

Comments
 (0)