LAS VEGAS, NV - MAY 17: Singers Jennifer Lopez (L) and Meghan Trainor attend the Nick Jonas "Live In Concert" Tour Announceme
Kevin Mazur/BMA2015/WireImage

Jennifer Lopez's "Ain't Your Mama" single received tons of backlash since its release last week, due to Dr. Luke having a hand in production. But according to Meghan Trainor, the singer didn't know the producer (who is in a legal battle with Kesha over alleged sexual abuse) was a part of the project.

"[It was] not fair on her, not at all," Trainor (one of the song's co-writers) told Digital Spy in regards to all the critique towards J. Lo:

“I texted her the song and she had no idea—she thought I did it alone by myself at my house, which a lot of people think because I do do that. I sent it to her and said, ‘Do you like the song?’ and she said, ‘I love the song, my kid loves the song—he’s made me play it five times already so I know it’s a hit—when can I cut it?’, so I said immediately, ‘Whenever you want!'”

Trainor went on to say that Epic Records' L.A. Reid wanted the pair to work together, and that she gave Lopez three songs including "Ain't Your Mama" as potential album cuts. 

While it may have been a mindless mistake on Lopez's part, she should definitely check song credits in the future—especially if it features a producer in the middle of a controversial lawsuit.