package org.bean.jandan.model;

import java.util.ArrayList;

/**
 * Created by liuyulong@yixin.im on 2015/4/27.
 */
public class Picture extends Comment {

    private String[] pics;

    public String[] getPics() {
        return pics;
    }

    public void setPics(String[] pics) {
        this.pics = pics;
    }

    public ArrayList<SinglePicture> toSinglePictures() {
        ArrayList<SinglePicture> pictures = new ArrayList<>();
        for (String pic : pics) {
            SinglePicture singlePicture = new SinglePicture(comment_ID, comment_post_ID, comment_author,
                    comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_karma, comment_approved, comment_agent, comment_type, comment_parent, comment_subscribe, comment_reply_ID, vote_positive, vote_negative, text_content, pic);
            pictures.add(singlePicture);
        }
        return pictures;
    }
}

@@ -431,16 +431,83 @@
 st%3C%3E();%0A
+        if (pics == null) %7B%0A            return pictures;%0A        %7D%0A
         

fix np crash