Checking graphic state exists for previous page before duping when starting new_page

Whenver pdf.start_new_page is called. The previous page graphic_state is duped without checking if graphic state exists for the previous page which result in can't dup nil class error