Remove unnecessary force and safe checks.

Resolves #13766
This commit is contained in:
Grzegorz Bobryk
2024-11-03 13:35:20 +01:00
committed by Greyson Parrelli
parent 3a5dc4e731
commit be92b3cf0a
6 changed files with 7 additions and 7 deletions

View File

@@ -69,7 +69,7 @@ object AttachmentUploadUtil {
@Throws(IOException::class)
private fun getImageBlurHash(context: Context, attachment: Attachment): String? {
if (attachment.blurHash != null) {
return attachment.blurHash!!.hash
return attachment.blurHash.hash
}
if (attachment.uri == null) {

View File

@@ -282,7 +282,7 @@ class ChatItemArchiveExporter(
var previousEdits = revisionMap[record.latestRevisionId]
if (previousEdits == null) {
previousEdits = ArrayList()
revisionMap[record.latestRevisionId!!] = previousEdits
revisionMap[record.latestRevisionId] = previousEdits
}
previousEdits += builder.build()
}

View File

@@ -226,10 +226,10 @@ class SegmentedProgressBar : View, ViewPager.OnPageChangeListener, View.OnTouchL
0, segments.lastIndex -> {
path.reset()
path.addRoundRect(rectangle, corners, Path.Direction.CW)
canvas?.drawPath(path, drawingComponents.second[drawingIndex])
canvas.drawPath(path, drawingComponents.second[drawingIndex])
}
else -> canvas?.drawRect(
else -> canvas.drawRect(
rectangle,
drawingComponents.second[drawingIndex]
)

View File

@@ -116,7 +116,7 @@ class CallLinkTable(context: Context, databaseHelper: SignalDatabase) : Database
AppDependencies.databaseObserver.notifyCallLinkObservers(callLink.roomId)
AppDependencies.databaseObserver.notifyCallUpdateObservers()
return recipientId!!
return recipientId
}
fun updateCallLinkCredentials(

View File

@@ -54,7 +54,7 @@ class CreateReleaseChannelJob private constructor(parameters: Parameters) : Base
Log.i(TAG, "Already created Release Channel recipient ${SignalStore.releaseChannel.releaseChannelRecipientId}")
val recipient = Recipient.resolved(SignalStore.releaseChannel.releaseChannelRecipientId!!)
if (recipient.profileAvatar == null || recipient.profileAvatar?.isEmpty() == true) {
if (recipient.profileAvatar.isNullOrEmpty()) {
setAvatar(recipient.id)
}
} else {

View File

@@ -158,7 +158,7 @@ data class SafetyNumberFingerprint(
result = 31 * result + (localIdentityKey?.hashCode() ?: 0)
result = 31 * result + (remoteStableIdentifier?.contentHashCode() ?: 0)
result = 31 * result + (remoteIdentityKey?.hashCode() ?: 0)
result = 31 * result + (fingerprint?.hashCode() ?: 0)
result = 31 * result + fingerprint.hashCode()
return result
}
}