From 616e3597dbb0aabc191c1413092ddd1ab50d3925 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 22 May 2020 04:57:40 +0100 Subject: [PATCH] fix edit channel crash --- app/src/main/java/io/lbry/browser/MainActivity.java | 4 +++- .../java/io/lbry/browser/ui/channel/ChannelFormFragment.java | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/lbry/browser/MainActivity.java b/app/src/main/java/io/lbry/browser/MainActivity.java index d8ead83e..436f4c28 100644 --- a/app/src/main/java/io/lbry/browser/MainActivity.java +++ b/app/src/main/java/io/lbry/browser/MainActivity.java @@ -349,13 +349,15 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener }); super.onCreate(savedInstanceState); - castContext = CastContext.getSharedInstance(this); dbHelper = new DatabaseHelper(this); checkNotificationOpenIntent(getIntent()); setContentView(R.layout.activity_main); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); + // TODO: Check Google Play Services availability + // castContext = CastContext.getSharedInstance(this); + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.content_main), new OnApplyWindowInsetsListener() { @Override public WindowInsetsCompat onApplyWindowInsets(View v, WindowInsetsCompat insets) { diff --git a/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java b/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java index 3f942672..4f3d2b7a 100644 --- a/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java +++ b/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java @@ -289,11 +289,12 @@ public class ChannelFormFragment extends BaseFragment implements } private void validateAndSaveClaim(Claim claim) { - String channelName = claim.getName().startsWith("@") ? claim.getName().substring(1) : claim.getName(); - if (Helper.isNullOrEmpty(channelName)) { + if (Helper.isNullOrEmpty(claim.getName())) { showError(getString(R.string.please_enter_channel_name)); return; } + + String channelName = claim.getName().startsWith("@") ? claim.getName().substring(1) : claim.getName(); if (!LbryUri.isNameValid(channelName)) { showError(getString(R.string.channel_name_invalid_characters)); return;