mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-03-31 09:13:38 -04:00
minor: moved blob variable to inner scope
This commit is contained in:
parent
43e1a379ac
commit
8840a13a8f
@ -5,20 +5,17 @@ import java.util.UUID
|
|||||||
import java.io.ByteArrayInputStream
|
import java.io.ByteArrayInputStream
|
||||||
import lc.database.Statements
|
import lc.database.Statements
|
||||||
import lc.core.CaptchaProviders
|
import lc.core.CaptchaProviders
|
||||||
import java.sql.Blob
|
|
||||||
|
|
||||||
|
|
||||||
object Captcha {
|
object Captcha {
|
||||||
|
|
||||||
def getCaptcha(id: Id): Array[Byte] = {
|
def getCaptcha(id: Id): Array[Byte] = {
|
||||||
var image: Array[Byte] = null
|
var image: Array[Byte] = null
|
||||||
var blob: Blob = null
|
|
||||||
try {
|
try {
|
||||||
val imagePstmt = Statements.tlStmts.get.imagePstmt
|
val imagePstmt = Statements.tlStmts.get.imagePstmt
|
||||||
imagePstmt.setString(1, id.id)
|
imagePstmt.setString(1, id.id)
|
||||||
val rs: ResultSet = imagePstmt.executeQuery()
|
val rs: ResultSet = imagePstmt.executeQuery()
|
||||||
if (rs.next()) {
|
if (rs.next()) {
|
||||||
blob = rs.getBlob("image")
|
val blob = rs.getBlob("image")
|
||||||
if (blob != null) {
|
if (blob != null) {
|
||||||
image = blob.getBytes(1, blob.length().toInt)
|
image = blob.getBytes(1, blob.length().toInt)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user