Added checks for empty tweet messages.
This commit is contained in:
parent
751a8bafa3
commit
6cd93b9334
|
@ -202,7 +202,7 @@ public class Hebdobot extends PircBot
|
|||
*/
|
||||
public void notifyTwitter(final String message)
|
||||
{
|
||||
if (this.twitterSettings.isValid())
|
||||
if ((this.twitterSettings.isValid()) && (StringUtils.isNotBlank(message)))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -88,6 +88,12 @@ public class TwitterClient
|
|||
* the twitter exception
|
||||
*/
|
||||
public void tweet(final String message) throws TwitterException
|
||||
{
|
||||
if (StringUtils.isBlank(message))
|
||||
{
|
||||
logger.info("Empty message => tweet aborted.");
|
||||
}
|
||||
else
|
||||
{
|
||||
ConfigurationBuilder config = new ConfigurationBuilder();
|
||||
config.setDebugEnabled(true);
|
||||
|
@ -102,3 +108,4 @@ public class TwitterClient
|
|||
logger.info("Tweet result [" + status.getText() + "].");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue