By making a gift unknowingly to an undeserving Brahmana one does not commit sin. The ignorant omission of behaving with liberality towards a deserving person does not lead to sin.
अनर्हे ब्राह्मणे दत्तमज्ञानात् तन्न दूषकम्। सत्काराणां तथा तीर्थे नित्यं वाप्रतिपादनम्॥