Skip to content

NullPointerException Crash In Generated class DeepLinkModuleRegistry-> Utils.readMatchIndexFromStrings #368

@lokeshkalal-gojek

Description

@lokeshkalal-gojek

Issue Details

DeepLinkDispatch 6.2.2
Kotlin 1.9.25
KSP 1.9.25-1.0.20

  • We started facing this after we updated the Deeplink Dispatch Library to 1.9.25-1.0.20 and moved to KSP from Kapt
  • Seems like this is happening kind of one time for per/few users
  • Utils.readMatchIndexFromStrings is called from generated class DeepLinkModuleRegistry and its not null.
  • We checked the Generated code in DeepLinkModuleRegistry class and string passed is not null.

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'byte[] java.lang.String.getBytes(java.nio.charset.Charset)' on a null object reference at com.airbnb.deeplinkdispatch.base.Utils.readMatchIndexFromStrings(Utils.kt:47) at com.navigation.api.deeplink.DeepLinkModuleRegistry.<init>(DeepLinkModuleRegistry.java) at com.entrypoint.Initializer$Companion.getDeeplinkParsers(Initializer.kt:339) at com.entrypoint.Initializer.parser$entry_point_release(Initializer.kt:314) at com.entrypoint.Initializer.initNavigator(Initializer.kt:163) at com.entrypoint.Initializer.init(Initializer.kt:142) at com.home.internal.initializer.Initializers.init(Initializers.kt:95) at com.home.internal.initializer.Initializers.access$getModules$p(Initializers.kt:21) at com.home.internal.initializer.Initializers$optPureRegistration$1$2$1.invokeSuspend(Initializers.kt:49) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:15811)

`import com.airbnb.deeplinkdispatch.BaseRegistry;
import com.airbnb.deeplinkdispatch.base.Utils;

public final class DeepLinkModuleRegistry extends BaseRegistry {
public DeepLinkModuleRegistry() {
super(Utils.readMatchIndexFromStrings(new String[] {matchIndex0(),}),
new String[] {});
}

private static String matchIndex0() {
    return "it has big generated string";
}

}

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions