This is fixed in the next release.
This error occurred when adding an attachment to the first post of a discussion that had not been created yet, or to the first comment in the main discussion for a page. The error did not prevent the attachment from being successfully added, since this was an expected case.