strictNullChecks (#4666)
* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip
This commit is contained in:
@@ -13,13 +13,19 @@ const logger = queueLogger.createSubLogger('import-following');
|
||||
export async function importFollowing(job: Bull.Job, done: any): Promise<void> {
|
||||
logger.info(`Importing following of ${job.data.user.id} ...`);
|
||||
|
||||
const user = await Users.findOne({
|
||||
id: job.data.user.id
|
||||
});
|
||||
const user = await Users.findOne(job.data.user.id);
|
||||
if (user == null) {
|
||||
done();
|
||||
return;
|
||||
}
|
||||
|
||||
const file = await DriveFiles.findOne({
|
||||
id: job.data.fileId
|
||||
});
|
||||
if (file == null) {
|
||||
done();
|
||||
return;
|
||||
}
|
||||
|
||||
const csv = await downloadTextFile(file.url);
|
||||
|
||||
@@ -31,11 +37,11 @@ export async function importFollowing(job: Bull.Job, done: any): Promise<void> {
|
||||
try {
|
||||
const { username, host } = parseAcct(line.trim());
|
||||
|
||||
let target = isSelfHost(host) ? await Users.findOne({
|
||||
let target = isSelfHost(host!) ? await Users.findOne({
|
||||
host: null,
|
||||
usernameLower: username.toLowerCase()
|
||||
}) : await Users.findOne({
|
||||
host: toPuny(host),
|
||||
host: toPuny(host!),
|
||||
usernameLower: username.toLowerCase()
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user