package com.thebluealliance.androidclient.subscribers;

import com.google.gson.JsonObject;

import com.thebluealliance.androidclient.models.BasicModel;
import com.thebluealliance.androidclient.models.Match;

public class MatchBreakdownSubscriber extends BaseAPISubscriber<Match, JsonObject> {

    @Override
    public void parseData() throws BasicModel.FieldNotDefinedException {
        if (mAPIData.getYear() == 2016) {
            // Currently only support 2016 matches
            mDataToBind = mAPIData.getBreakdown();
        } else {
            mDataToBind = null;
        }
    }
}

@@ -467,16 +467,38 @@
 matches%0A
+            try %7B%0A    
         
@@ -540,16 +540,325 @@
 down();%0A
+                if (mDataToBind.entrySet().isEmpty()) %7B%0A                    mDataToBind = null;%0A                %7D%0A            %7D catch (BasicModel.FieldNotDefinedException ex) %7B%0A                // Match is unplayed or doesn't have a breakdown. Fail gracefully%0A                mDataToBind = null;%0A            %7D%0A
         

Fix breakdowns for unplayed matches