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;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.inject.Provides;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Map;
|
||||
@@ -98,9 +99,9 @@ public class TwitchPlugin extends Plugin implements TwitchListener, ChatboxInput
|
||||
|
||||
private synchronized void connect()
|
||||
{
|
||||
if (twitchConfig.username() != null
|
||||
&& twitchConfig.oauthToken() != null
|
||||
&& twitchConfig.channel() != null)
|
||||
if (!Strings.isNullOrEmpty(twitchConfig.username())
|
||||
&& !Strings.isNullOrEmpty(twitchConfig.oauthToken())
|
||||
&& !Strings.isNullOrEmpty(twitchConfig.channel()))
|
||||
{
|
||||
String channel = twitchConfig.channel().toLowerCase();
|
||||
if (!channel.startsWith("#"))
|
||||
|
||||
Reference in New Issue
Block a user