Check for empty strings when initializing twitch client
When setting is cleared via user its value is set to empty string and never to null again. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.twitch;
|
package net.runelite.client.plugins.twitch;
|
||||||
|
|
||||||
|
import com.google.common.base.Strings;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -98,9 +99,9 @@ public class TwitchPlugin extends Plugin implements TwitchListener, ChatboxInput
|
|||||||
|
|
||||||
private synchronized void connect()
|
private synchronized void connect()
|
||||||
{
|
{
|
||||||
if (twitchConfig.username() != null
|
if (!Strings.isNullOrEmpty(twitchConfig.username())
|
||||||
&& twitchConfig.oauthToken() != null
|
&& !Strings.isNullOrEmpty(twitchConfig.oauthToken())
|
||||||
&& twitchConfig.channel() != null)
|
&& !Strings.isNullOrEmpty(twitchConfig.channel()))
|
||||||
{
|
{
|
||||||
String channel = twitchConfig.channel().toLowerCase();
|
String channel = twitchConfig.channel().toLowerCase();
|
||||||
if (!channel.startsWith("#"))
|
if (!channel.startsWith("#"))
|
||||||
|
|||||||
Reference in New Issue
Block a user