Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug that occurred when handling NoneType. #677

Closed
wants to merge 3 commits into from
Closed

Fixed a bug that occurred when handling NoneType. #677

wants to merge 3 commits into from

Conversation

happppyboy
Copy link
Contributor

A runtime error was found while testing by linking between the VCX library in the indy-sdk repository and Aries cloudagent.

That is, the problem occurred because the value of 'non_revoked' field was not initialized to '{}' and the value was set to 'None'.

This occurs when the value of the 'non_revoked' field in the presentation record is loaded in the process of sending presentation (/present-proof/records/{pres_ex_id}/send-presentation REST API).

When a presentation proof is requested using the VCX library, the 'non_revoked' field value in the record is set to the 'None' value.
So, you can see that the return value of the dict.get() function is set to 'None' instead of '{}'.

So, it works normally only when the part that checks the field is strengthened as follows.

Minseong Jeong and others added 3 commits August 21, 2020 15:40
Signed-off-by: Minseong Jeong <msjeong482@gmail.com>
The code was too long, so it was treated as a variable.

Signed-off-by: Minseong Jeong <msjeong482@gmail.com>
The code was too long, so it was treated as a variable.

Signed-off-by: Minseong Jeong <msjeong482@gmail.com>
@codecov-commenter
Copy link

Codecov Report

Merging #677 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #677   +/-   ##
=======================================
  Coverage   98.98%   98.98%           
=======================================
  Files         251      251           
  Lines       13560    13561    +1     
=======================================
+ Hits        13423    13424    +1     
  Misses        137      137           

@@ -329,8 +329,9 @@ async def create_presentation(
epoch_now = int(time.time())

non_revoc_interval = {"from": 0, "to": epoch_now}
non_revoked_value = presentation_request.get("non_revoked")
Copy link
Contributor

@sklump sklump Aug 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can tighten this up without needing non_revoked_value while satisfying black. I will submit in a new PR.

@sklump
Copy link
Contributor

sklump commented Aug 21, 2020

#680 supersedes.

@happppyboy happppyboy deleted the runtime-error branch August 21, 2020 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants