Skip to content

Commit

Permalink
exception on reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
wzieba committed Nov 1, 2023
1 parent a0bf983 commit 93ef1e9
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,17 @@ class FunctionalTests {
}

private fun initializeTracker(activity: Activity): ParselyTracker {
return ParselyTracker.sharedInstance(
siteId, flushInterval.inWholeSeconds.toInt(), activity.application
).apply {
val f: Field = this::class.java.getDeclaredField("ROOT_URL")
f.isAccessible = true
f.set(this, url)

return try {
ParselyTracker.sharedInstance(
siteId, flushInterval.inWholeSeconds.toInt(), activity.application
).apply {
val f: Field = this::class.java.getDeclaredField("ROOT_URL")
f.isAccessible = true
f.set(this, url)
}
} catch (exception: Exception) {
throw RuntimeException("Failed to initialize tracker", exception)
}
}

Expand Down

0 comments on commit 93ef1e9

Please sign in to comment.