Skip to content

Commit

Permalink
Use DI if getStorageManager is null
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Jun 6, 2024
1 parent 65bd099 commit 3365117
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab

@Inject UserAccountManager accountManager;
@Inject AppPreferences preferences;
@Inject FileDataStorageManager fileDataStorageManager;

private AppPreferences.Listener onPreferencesChanged = new AppPreferences.Listener() {
@Override
Expand Down Expand Up @@ -174,6 +175,10 @@ public Optional<User> getUser() {
}

public FileDataStorageManager getStorageManager() {
return sessionMixin.getStorageManager();
FileDataStorageManager result = sessionMixin.getStorageManager();
if (result == null) {
result = fileDataStorageManager;
}
return result;
}
}

0 comments on commit 3365117

Please sign in to comment.