Skip to content

Commit

Permalink
oc: Modify read method to return empty string instead of nil
Browse files Browse the repository at this point in the history
Changed the `read` method in `mill_engine.mm` to return an empty NSString (`@""`)
instead of `nil`. This addresses the issue where `nil` was being returned from a
method expected to return a non-null value, ensuring compliance with the
method's contract and preventing potential runtime errors.
  • Loading branch information
calcitem committed Jan 27, 2024
1 parent 91631e8 commit 3ed2d14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui/flutter_app/command/mill_engine.mm
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ -(NSString *) read {
bool got_response = channel->popupResponse(buffer);

if (!got_response) {
return nil;
return @"";
}

NSString *line = [NSString stringWithFormat:@"%s", buffer];
Expand Down

0 comments on commit 3ed2d14

Please sign in to comment.