mirror of
				https://github.com/SimpleMobileTools/Simple-Gallery.git
				synced 2025-06-05 21:59:19 +02:00 
			
		
		
		
	add another null check at obtaining the room database
This commit is contained in:
		| @@ -22,9 +22,11 @@ abstract class GalleryDataBase : RoomDatabase() { | ||||
|         fun getInstance(context: Context): GalleryDataBase { | ||||
|             if (db == null) { | ||||
|                 synchronized(GalleryDataBase::class) { | ||||
|                     db = Room.databaseBuilder(context.applicationContext, GalleryDataBase::class.java, "gallery.db") | ||||
|                             .fallbackToDestructiveMigration() | ||||
|                             .build() | ||||
|                     if (db == null) { | ||||
|                         db = Room.databaseBuilder(context.applicationContext, GalleryDataBase::class.java, "gallery.db") | ||||
|                                 .fallbackToDestructiveMigration() | ||||
|                                 .build() | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|             return db!! | ||||
|   | ||||
		Reference in New Issue
	
	Block a user