(librarymodel) Fix a crash when checking all items