Implicit conversion from nullable pointer 'NSString * _Nullable' to non-nullable pointer type 'NSString * _Nonnull' error + Add missing import.
Summary:
This diff fixes this compilation error that appear in the next diff (in case I don't fix it before).
```
Action failed: fbsource//xplat/sonar/iOS/Plugins/FlipperKitDatabasesPlugin:FlipperKitDatabasesPlugin (cxx_compile FlipperKitDatabasesPlugin/DatabasesManager.m (pic))
Local command returned non-zero exit code 1
Reproduce locally: `env -- "BUCK_SCRATCH_PATH=buck-out/v2/tmp/fbsource/4f538045b2fada5e/xplat/sonar/iOS/Plugins/FlipperK ...<omitted>... erKitDatabasesPlugin__/__dep_files_intermediaries__/FlipperKitDatabasesPlugin/DatabasesManager.m.pic (run `buck2 log what-failed` to get the full command)`
stdout:
stderr:
xplat/sonar/iOS/Plugins/FlipperKitDatabasesPlugin/FlipperKitDatabasesPlugin/DatabasesManager.m:121:57: error: implicit conversion from nullable pointer 'NSString * _Nullable' to non-nullable pointer type 'NSString * _Nonnull' [-Werror,-Wnullable-to-nonnull-conversion]
stringByAppendingString:exception.reason]];
^
xplat/sonar/iOS/Plugins/FlipperKitDatabasesPlugin/FlipperKitDatabasesPlugin/DatabasesManager.m:157:57: error: implicit conversion from nullable pointer 'NSString * _Nullable' to non-nullable pointer type 'NSString * _Nonnull' [-Werror,-Wnullable-to-nonnull-conversion]
stringByAppendingString:exception.reason]];
^
xplat/sonar/iOS/Plugins/FlipperKitDatabasesPlugin/FlipperKitDatabasesPlugin/DatabasesManager.m:191:57: error: implicit conversion from nullable pointer 'NSString * _Nullable' to non-nullable pointer type 'NSString * _Nonnull' [-Werror,-Wnullable-to-nonnull-conversion]
stringByAppendingString:exception.reason]];
^
3 errors generated.
```
Differential Revision: D48438432
fbshipit-source-id: acba91ec8e4fdab2c09a1e98387c203aa0d49489
This commit is contained in:
committed by
Facebook GitHub Bot
parent
bf6afe329f
commit
7210c8944b
@@ -5,6 +5,8 @@
|
|||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
@protocol DatabaseDescriptor<NSObject>
|
@protocol DatabaseDescriptor<NSObject>
|
||||||
- (NSString*)name;
|
- (NSString*)name;
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -115,10 +115,11 @@
|
|||||||
databaseGetTableDataResponseToDictionary:tableDataResponse];
|
databaseGetTableDataResponseToDictionary:tableDataResponse];
|
||||||
[responder success:response];
|
[responder success:response];
|
||||||
} @catch (NSException* exception) {
|
} @catch (NSException* exception) {
|
||||||
|
NSString* reason = exception.reason ?: @"Unknown error";
|
||||||
NSDictionary* errorResponse = [ObjectMapper
|
NSDictionary* errorResponse = [ObjectMapper
|
||||||
errorWithCode:DatabasesErrorCodesSqlExecutionException
|
errorWithCode:DatabasesErrorCodesSqlExecutionException
|
||||||
message:[kDatabasesErrorCodesSqlExecutionExceptionMessage
|
message:[kDatabasesErrorCodesSqlExecutionExceptionMessage
|
||||||
stringByAppendingString:exception.reason]];
|
stringByAppendingString:reason]];
|
||||||
[responder error:errorResponse];
|
[responder error:errorResponse];
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
@@ -151,10 +152,11 @@
|
|||||||
databaseGetTableStructureResponseToDictionary:tableStructure];
|
databaseGetTableStructureResponseToDictionary:tableStructure];
|
||||||
[responder success:response];
|
[responder success:response];
|
||||||
} @catch (NSException* exception) {
|
} @catch (NSException* exception) {
|
||||||
|
NSString* reason = exception.reason ?: @"Unknown error";
|
||||||
NSDictionary* errorResponse = [ObjectMapper
|
NSDictionary* errorResponse = [ObjectMapper
|
||||||
errorWithCode:DatabasesErrorCodesSqlExecutionException
|
errorWithCode:DatabasesErrorCodesSqlExecutionException
|
||||||
message:[kDatabasesErrorCodesSqlExecutionExceptionMessage
|
message:[kDatabasesErrorCodesSqlExecutionExceptionMessage
|
||||||
stringByAppendingString:exception.reason]];
|
stringByAppendingString:reason]];
|
||||||
[responder error:errorResponse];
|
[responder error:errorResponse];
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
@@ -185,10 +187,11 @@
|
|||||||
[ObjectMapper databaseGetTableInfoResponseToDictionary:tableInfo];
|
[ObjectMapper databaseGetTableInfoResponseToDictionary:tableInfo];
|
||||||
[responder success:response];
|
[responder success:response];
|
||||||
} @catch (NSException* exception) {
|
} @catch (NSException* exception) {
|
||||||
|
NSString* reason = exception.reason ?: @"Unknown error";
|
||||||
NSDictionary* errorResponse = [ObjectMapper
|
NSDictionary* errorResponse = [ObjectMapper
|
||||||
errorWithCode:DatabasesErrorCodesSqlExecutionException
|
errorWithCode:DatabasesErrorCodesSqlExecutionException
|
||||||
message:[kDatabasesErrorCodesSqlExecutionExceptionMessage
|
message:[kDatabasesErrorCodesSqlExecutionExceptionMessage
|
||||||
stringByAppendingString:exception.reason]];
|
stringByAppendingString:reason]];
|
||||||
[responder error:errorResponse];
|
[responder error:errorResponse];
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
@@ -215,10 +218,11 @@
|
|||||||
[ObjectMapper databaseExecuteSqlResponseToDictionary:sqlResponse];
|
[ObjectMapper databaseExecuteSqlResponseToDictionary:sqlResponse];
|
||||||
[responder success:response];
|
[responder success:response];
|
||||||
} @catch (NSException* exception) {
|
} @catch (NSException* exception) {
|
||||||
|
NSString* reason = exception.reason ?: @"Unknown error";
|
||||||
NSDictionary* errorResponse = [ObjectMapper
|
NSDictionary* errorResponse = [ObjectMapper
|
||||||
errorWithCode:DatabasesErrorCodesSqlExecutionException
|
errorWithCode:DatabasesErrorCodesSqlExecutionException
|
||||||
message:[kDatabasesErrorCodesSqlExecutionExceptionMessage
|
message:[kDatabasesErrorCodesSqlExecutionExceptionMessage
|
||||||
stringByAppendingString:exception.reason]];
|
stringByAppendingString:reason]];
|
||||||
[responder error:errorResponse];
|
[responder error:errorResponse];
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
|||||||
Reference in New Issue
Block a user