A Java library of Instagram's private API and wrapper of instagram4j. Surf Instagram programmatically, build bots, and a lot more. Just a line of code for every operation.
Apache License 2.0
47
stars
10
forks
source link
Bug, checking image extension when sending image message #25
public AsyncTask<Void> directMessage(@NotNull String username, @NotNull File photo) {
if (!photo.getName().endsWith(".jpg") || !photo.getName().endsWith(".png") || !photo.getName().endsWith("jpeg"))
throw new InstagramException("Unsupported file format. Only photos with jpg/png/jpeg extensions are allowed", Reasons.UNSUPPORTED_FILE_FORMAT);
....
}
==> || to &&
public AsyncTask<Void> directMessage(@NotNull String username, @NotNull File photo) {
if (!photo.getName().endsWith(".jpg") && !photo.getName().endsWith(".png") && !photo.getName().endsWith("jpeg"))
throw new InstagramException("Unsupported file format. Only photos with jpg/png/jpeg extensions are allowed", Reasons.UNSUPPORTED_FILE_FORMAT);
....
}
Instagram.java