Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Sports: Fix missing possession in NFL #2948

Merged
merged 1 commit into from
Aug 16, 2016
Merged

Conversation

mrshu
Copy link
Collaborator

@mrshu mrshu commented Aug 8, 2016

What does your Pull Request do (check all that apply)?

Choose the most relevant items and use the following title template to name
your Pull Request.

  • New Instant Answer: New {IA Name} Instant Answer
  • Improvement
    • Bug fix: Sports: Fix missing possession in NFL
    • Enhancement: {IA Name}: {Description of Improvements}
  • Non–Instant Answer
    • Other (Role, Template, Test, Documentation, etc.): {SpiceRole/Templates/Tests/Docs}: {Short Description}
Description of changes
  • The previous implementation assumed that the possession data will be
    always available. This might not be the case, especially when a game
    gets canceled or delayed.

    This commit fixes the situation by skipping the part of the code that
    requires the possession to be filled in.

Which issues (if any) does this fix?

See above

People to notify (@mention interested parties)

@b1ake


Instant Answer Page: https://duck.co/ia/view/sports

Maintainer: @b1ake

  • The previous implementation assumed that the possession data will be
    always available. This might not be the case, especially when a game
    gets canceled or delayed.

    This commit fixes the situation by skipping the part of the code that
    requires the possession to be filled in.

Signed-off-by: mr.Shu mr@shu.io

@daxtheduck
Copy link

daxtheduck commented Aug 8, 2016

Sports

Description: Placeholder - not a unique answer, but rather a shared library for other sports

Example Query: [blue jays games](https://beta.duckduckgo.com/?q=blue jays games), cardinals, vikings

Tab Name:

Source:

These are the important fields from the IA page. Please check these for errors or missing information and update the IA page


This is an automated message which will be updated as changes are made to the IA page

@@ -65,6 +65,11 @@
// fill boxscore with placeholder data
attrs.score = games.fillBoxscore(attrs.score, ops);

// finish here if there is no possession data
if (!attrs.score.possession) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! Is it possible that attr.scores is even undefined? If so, maybe we should catch that here too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@b1ake given the definition of fillBoxscore it seems that it easily might be.

Will update the PR, thanks for catching it!

* The previous implementation assumed that the possession data will be
  always available. This might not be the case, especially when a game
  gets cancelled or delayed.

  This commit fixes the situation by skipping the part of the code that
  requires the possession to be filled in.

Signed-off-by: mr.Shu <mr@shu.io>
@b1ake
Copy link
Contributor

b1ake commented Aug 16, 2016

👍

@b1ake b1ake merged commit 96546a0 into master Aug 16, 2016
@b1ake b1ake deleted the mrshu/fix-nfl-possession branch August 16, 2016 13:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants