diff --git a/NativeScript/NativeScript.h b/NativeScript/NativeScript.h index f9bcc9f1..85b56f9e 100644 --- a/NativeScript/NativeScript.h +++ b/NativeScript/NativeScript.h @@ -1,14 +1,16 @@ #import +NS_ASSUME_NONNULL_BEGIN + @interface Config : NSObject @property (nonatomic, retain) NSString* BaseDir; -@property (nonatomic, retain) NSString* ApplicationPath; -@property (nonatomic) void* MetadataPtr; +@property (nonatomic, retain, nullable) NSString* ApplicationPath; +@property (nonatomic, nullable) void* MetadataPtr; @property BOOL IsDebug; @property BOOL LogToSystemConsole; @property int ArgumentsCount; -@property (nonatomic) char** Arguments; +@property (nonatomic) char* _Nullable* _Nullable Arguments; @end @@ -26,3 +28,5 @@ - (bool)liveSync; @end + +NS_ASSUME_NONNULL_END diff --git a/NativeScript/inspector/JsV8InspectorClient.mm b/NativeScript/inspector/JsV8InspectorClient.mm index 7af9b0c6..9ba674ed 100644 --- a/NativeScript/inspector/JsV8InspectorClient.mm +++ b/NativeScript/inspector/JsV8InspectorClient.mm @@ -181,7 +181,9 @@ bool ShouldRewriteSourceMapURLs() { notify_post(NOTIFICATION("AppLaunching")); - for (int i = 1; i < argc; i++) { + // A nil Arguments array carries no flags whatever ArgumentsCount says, and a + // null element ends the list the way it does in a C argv. + for (int i = 1; argv != nullptr && i < argc && argv[i] != nullptr; i++) { BOOL startListening = NO; BOOL shouldWaitForDebugger = NO;