-
Notifications
You must be signed in to change notification settings - Fork 72
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
Check for a nil lastTime before use #283
Conversation
Not too sure about how to test this, happy to get some pointers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too sure about how to test this, happy to get some pointers.
I can't see an easy way to test it, apart from extracting the if-else block of code into its own function and creating a unit test just for it.
I can look at doing this but is seems a little overkill to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can look at doing this but is seems a little overkill to me.
agreed, besides the ongoing refactoring may help on that front too.
on a side point, I added a nit comment about simplifying the if logic for clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one @Nalum, thank you for your contribution. 🙇
LGTM
Thanks for your help and patience @pjbgf 👍 |
@Nalum please squash all commits into a single one. |
Signed-off-by: Luke Mallon (Nalum) <luke@mallon.ie>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you @Nalum 🥇
Fix: #246
Avoiding a nil-deref by checking the
lastTime
variable before using it.