Read this great article Stop checking for NULL pointers! It mentions that there are many other invalid pointers than NULL, which is the same idea I had recently with regard to foreign keys in databases.
To process an integrity check on an SQLite database:
$ sqlite3 database.sqlite 'pragma integrity_check'
Read about checking your Ubuntu version today and was reminded of lsb_release -a.