This repository was archived by the owner on May 15, 2024. It is now read-only.
Throw ArgumentNullException when passing null to a Share request#1413
Merged
mattleibow merged 3 commits intoxamarin:mainfrom Oct 7, 2020
Merged
Throw ArgumentNullException when passing null to a Share request#1413mattleibow merged 3 commits intoxamarin:mainfrom
mattleibow merged 3 commits intoxamarin:mainfrom
Conversation
mattleibow
reviewed
Oct 4, 2020
Comment on lines
+12
to
+17
| if (request == null) | ||
| throw new ArgumentNullException(nameof(request)); | ||
|
|
||
| if (string.IsNullOrEmpty(request.Text) && string.IsNullOrEmpty(request.Uri)) | ||
| throw new ArgumentNullException(nameof(request.Text)); | ||
|
|
Member
There was a problem hiding this comment.
Maybe we can move this to the shard layer? Then we don't need to duplicate the code in every platform.
Member
|
/azp run |
Mrnikbobjeff
suggested changes
Oct 5, 2020
Contributor
Mrnikbobjeff
left a comment
There was a problem hiding this comment.
Looking good just some minor nitpicks. The Exception nameof parameter is the most important change IMHO which needs to be adressed
f85a575 to
19934bf
Compare
mattleibow
approved these changes
Oct 6, 2020
Member
mattleibow
left a comment
There was a problem hiding this comment.
I think I quite like this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Ensures that all supported platforms throws the same exception when passing invalid argument to a Share request.
No sample added as this behavior can be validated by running the samples and sending a Share request without any arguments.
Bugs Fixed
API Changes
None.
Behavioral Changes
All platforms will now throw an
ArgumentNullExceptionwhen passingnullas parameter to Share API. Previously, the Tizen platform was throwing anArgumentNullExceptionand the other platforms would throw aNullReferenceExceptionwhen trying to access a property of anullobject.PR Checklist
mainat time of PR