Corrected a bug that throws notices in server log

As not all evens have actually a 'postid', that key needs to be checked inside the IF statement. I just got here from this question http://www.question2answer.org/qa/31356