Abdullah bin Abbas reported,

A man passed away whom the Messenger of Allah ﷺ had been visiting during his illness. They buried him at night, and when morning came they informed the Prophet ﷺ of his death.He asked, "What kept you from informing me?"They replied, "It was night and very dark, and we did not want to trouble you."So he went to the grave and prayed over him.

Ibn Majah 1530

Sahih

حدثنا علي بن محمد حدثنا أبو معاوية عن أبي إسحق الشيباني عن الشعبي

عن ابن عباس قال

مات رجل وكان رسول الله ﷺ يعوده فدفنوه بالليل فلما أصبح أعلموه فقال ما منعكم أن تعلموني قالوا كان الليل وكانت الظلمة فكرهنا أن نشق عليك فأتى قبره فصلى عليه

ابن ماجه 1530صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Funerals
Chapter
Prayer over the grave
Numbering
Darussalam 1530
Ibn Majah 1530