From a08fe2f6f5705afd4b31222b497873d2f12494b0 Mon Sep 17 00:00:00 2001 From: Victor Andreasson Date: Tue, 13 Aug 2024 08:54:37 +0200 Subject: [PATCH] Update DropboxRepoTest.kt --- .../test/java/com/orgzly/android/repos/DropboxRepoTest.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/test/java/com/orgzly/android/repos/DropboxRepoTest.kt b/app/src/test/java/com/orgzly/android/repos/DropboxRepoTest.kt index 0077e334c..1b49db0b4 100644 --- a/app/src/test/java/com/orgzly/android/repos/DropboxRepoTest.kt +++ b/app/src/test/java/com/orgzly/android/repos/DropboxRepoTest.kt @@ -42,8 +42,10 @@ class DropboxRepoTest : SyncRepoTest { @After fun tearDown() { - val dropboxRepo = syncRepo as DropboxRepo - dropboxRepo.deleteDirectory(syncRepo.uri) + if (this::syncRepo.isInitialized) { + val dropboxRepo = syncRepo as DropboxRepo + dropboxRepo.deleteDirectory(syncRepo.uri) + } } @Test @@ -130,4 +132,4 @@ class DropboxRepoTest : SyncRepoTest { override fun testRenameBook_sameSubfolderNewLeafName() { SyncRepoTest.testRenameBook_sameSubfolderNewLeafName(syncRepo) } -} \ No newline at end of file +}