A little know rule about kosher hamentashen is that the the 3 walls must be made on the sides BEFORE the filling is set in the middle, as the Shulchan Aruch rules in OC 688:1:
והוא שהוקף ולאח"כ ישב
As long as it was surrounded and then settled
To justify the common practice, he does bring down another opinion (which is not brought in the talmud Megillah 3b) that says that if the filling was originally set down in the middle with the intention of setting up the walls later, then it is still kosher.
Thankfully, the Rama there notes that we can assume in general that our hamentashen were made in the correct order, although Achronim debate if his assumptions regarding the bakers of Cracow, Poland apply to modern times.