Commit d9b05587 authored by Tiger Oakes's avatar Tiger Oakes Committed by Tiger Oakes
Browse files

Issue #3481 - Fix null checks for Q

parent 6d1363d9
......@@ -179,11 +179,10 @@ class QrFragment : Fragment() {
val availableImage = image
if (availableImage != null) {
val buffer = availableImage.planes[0].buffer
data = ByteArray(buffer.remaining())
buffer.get(data)
data = ByteArray(buffer.remaining()).also { buffer.get(it) }
val width = availableImage.width
val height = availableImage.height
val source = PlanarYUVLuminanceSource(data, width, height, 0, 0, width, height, false)
val source = PlanarYUVLuminanceSource(data!!, width, height, 0, 0, width, height, false)
val bitmap = BinaryBitmap(HybridBinarizer(source))
if (qrState == STATE_FIND_QRCODE) {
qrState = STATE_DECODE_PROGRESS
......
......@@ -330,12 +330,12 @@ class TabCollectionStorageTest {
)
assertEquals(2, storage.getTabCollectionsCount())
assertEquals(2, TabEntity.getStateDirectory(context.filesDir).listFiles().size)
assertEquals(2, TabEntity.getStateDirectory(context.filesDir).listFiles()?.size)
storage.removeAllCollections()
assertEquals(0, storage.getTabCollectionsCount())
assertEquals(0, TabEntity.getStateDirectory(context.filesDir).listFiles().size)
assertEquals(0, TabEntity.getStateDirectory(context.filesDir).listFiles()?.size)
}
private fun getAllCollections(): List<TabCollection> {
......
......@@ -87,7 +87,7 @@ sealed class Crash {
companion object {
fun fromIntent(intent: Intent): Crash {
val bundle = intent.getBundleExtra(INTENT_CRASH)
val bundle = intent.getBundleExtra(INTENT_CRASH)!!
return if (bundle.containsKey(INTENT_MINIDUMP_PATH)) {
NativeCodeCrash.fromBundle(bundle)
......
......@@ -80,8 +80,10 @@ class ExperimentsDebugActivity : Activity() {
intent.hasExtra(OVERRIDE_BRANCH_EXTRA_KEY)) {
val experiment = intent.getStringExtra(OVERRIDE_EXPERIMENT_EXTRA_KEY)
val branch = intent.getStringExtra(OVERRIDE_BRANCH_EXTRA_KEY)
logger.info("Override to the following experiment/branch:$experiment/$branch")
Experiments.setOverride(applicationContext, experiment, true, branch)
if (experiment != null && branch != null) {
logger.info("Override to the following experiment/branch:$experiment/$branch")
Experiments.setOverride(applicationContext, experiment, true, branch)
}
}
val intent = packageManager.getLaunchIntentForPackage(packageName)
......
......@@ -395,7 +395,7 @@ open class FxaAccountManager(
private fun processQueueAsync(event: Event): Deferred<Unit> = CoroutineScope(coroutineContext).async {
eventQueue.add(event)
do {
val toProcess = eventQueue.poll()
val toProcess: Event = eventQueue.poll()!!
val transitionInto = nextState(state, toProcess)
if (transitionInto == null) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment