SparkFileUploadPlugin.messageReceived() avoid NPE

This commit is contained in:
Sergey Ponomarev
2025-10-19 10:55:16 +03:00
committed by Guus der Kinderen
parent 27f2d20c18
commit a6987246cf

View File

@ -47,19 +47,10 @@ public class SparkFileUploadPlugin implements Plugin, ChatRoomListener, GlobalMe
@Override
public void messageReceived(ChatRoom room, Message message) {
try {
String body = message.getBody();
if ( (body.startsWith("https://") || body.startsWith("http://")) && body.contains("/httpfileupload/") )
{
Log.warning("http file upload get url " + message.getBody());
}
} catch (Exception e) {
// i don't care
String body = message.getBody();
if (body != null && (body.startsWith("https://") || body.startsWith("http://")) && body.contains("/httpfileupload/")) {
Log.warning("http file upload get url " + message.getBody());
}
}
@Override