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

Check for None in CreateEvent description #89

Merged
merged 1 commit into from
Nov 2, 2016
Merged

Check for None in CreateEvent description #89

merged 1 commit into from
Nov 2, 2016

Conversation

SanketDG
Copy link
Contributor

No description provided.

@codecov-io
Copy link

Current coverage is 95.18% (diff: 100%)

Merging #89 into master will not change coverage

@@             master        #89   diff @@
==========================================
  Files            34         34          
  Lines          2076       2076          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits           1976       1976          
  Misses          100        100          
  Partials          0          0          

Powered by Codecov. Last update eebb2cf...9a0d16f

@donnemartin
Copy link
Owner

Hi @SanketDG, thanks for the PR! I'll try to review it this week.

@donnemartin
Copy link
Owner

donnemartin commented Nov 2, 2016

Looks good! I think the results from the API might have changed which might have caused this issue.

Note how the description key lookup is wrapped in a try/except block catching a KeyError. I suspect the description key might not have been sent in the past if the event description is missing, but we see it is now sent with a value of None.

        try:
            item += self._format_indented_message(
                ('' if event.payload['description'] is None
                 else event.payload['description']))
        except KeyError:
            pass

I'd leave the code catching KeyError in place as a further safeguard.

@donnemartin donnemartin merged commit 9a0d16f into donnemartin:master Nov 2, 2016
@SanketDG SanketDG deleted the fix-description branch November 4, 2016 13:04
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.

3 participants