4b3e6dfbb1b3a575a01e6f9915db026d356c6251 hiram Wed Jul 1 17:17:29 2026 -0700 and can check ottoTable exists before making central connection refs #37839 diff --git src/hg/hubApi/liftOver.c src/hg/hubApi/liftOver.c index 857cb585157..8d1bde4027e 100644 --- src/hg/hubApi/liftOver.c +++ src/hg/hubApi/liftOver.c @@ -131,52 +131,55 @@ jsonWriteString(jw, "fudgeThick", chain->fudgeThick); jsonWriteObjectEnd(jw); } jsonWriteListEnd(jw); jsonWriteNumber(jw, "totalLiftOvers", totalRows); int chainListCount = slCount(chainList); jsonWriteNumber(jw, "itemsReturned", chainListCount); liftOverChainFreeList(&chainList); /* if no chain rows for this pair, check ottoRequest for any existing * row (any status) so the user is told their pair has already been * submitted instead of being allowed to create a duplicate row */ if (chainListCount == 0 && isNotEmpty(fromDb) && isNotEmpty(toDb)) { char *ottoTable = cfgOption("ottoTable"); + if (isNotEmpty(ottoTable)) + { struct sqlConnection *ottoConn = hConnectOtto(); - if (isNotEmpty(ottoTable) && sqlTableExists(ottoConn, ottoTable)) + if (sqlTableExists(ottoConn, ottoTable)) { struct dyString *pq = newDyString(0); sqlDyStringPrintf(pq, "SELECT id, status, requestTime FROM %s " "WHERE requestType='liftOver' AND " "((fromDb='%s' AND toDb='%s') OR (fromDb='%s' AND toDb='%s')) " "ORDER BY requestTime DESC LIMIT 1", ottoTable, fromDb, toDb, toDb, fromDb); char **row; struct sqlResult *sr = sqlGetResult(ottoConn, dyStringCannibalize(&pq)); if ((row = sqlNextRow(sr)) != NULL) { jsonWriteBoolean(jw, "pending", TRUE); jsonWriteNumber(jw, "pendingStatus", sqlSigned(row[1])); jsonWriteString(jw, "pendingRequestTime", row[2]); } sqlFreeResult(&sr); } hDisconnectOtto(&ottoConn); } + } apiFinishOutput(0, NULL, jw); hDisconnectCentral(&conn); } static void loginStatus() /* output current user login status as JSON */ { /* wikiLinkUserName() handles all cookie validation internally */ char *userName = wikiLinkUserName(); struct jsonWrite *jw = apiStartOutput(); char hgLoginLink[2048]; boolean privateHost = hIsPrivateHost(); /* can not use hgcentral hglogin from hgwdev/genome-test */ if (privateHost)