Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] Possible NPE in DownlinkRequestSerDes class

Hi Vitaliy,

Thx a lot. This should be fixed in master now : https://github.com/eclipse/leshan/commit/4d1af8df3b439b2f0c763a74bd5bd75f9db5cfce

SImon

Le 18/01/2017 à 10:52, zakhav@xxxxxxx a écrit :
Hi guys!

Seems that there is a small mistake in
leshan-server-cluster\src\main\java\org\eclipse\leshan\server\cluster\serialization\DownlinkRequestSerDes.java
class which can cause eaither wrong request deserialization or NPE error. I mean the code

            public void visit(ObserveRequest request) {
                o.add("kind", "observe");
                if (request.getFormat() == null)
                    o.add("contentFormat", request.getFormat().getCode());
            }

            public void visit(ReadRequest request) {
                o.add("kind", "read");
                if (request.getFormat() == null)
                    o.add("contentFormat", request.getFormat().getCode());
            }

As I understand in both cases should be

if (request.getFormat() != null)
instead of
if (request.getFormat() == null)

Best regards

Vitaliy


_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev


Back to the top