What version of macOS are you running? How frequently does this happen? Boot into Safe mode and see if it happens there.