Skip to content

Commit d87bd34

Browse files
authored
Merge pull request #26 from styleseller-co-kr/bug/fix_checking_image_extension
[MOD] fixed bug, checking image extension for sending image messages
2 parents 76fb0c8 + ddbf5ab commit d87bd34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

EasyInsta/src/main/java/com/xcoder/easyinsta/Instagram.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public AsyncTask<Void> directMessage(@NotNull String username, @NotNull String m
307307
* @return A {@link AsyncTask} indication success or failure of the request
308308
*/
309309
public AsyncTask<Void> directMessage(@NotNull String username, @NotNull File photo) {
310-
if (!photo.getName().endsWith(".jpg") || !photo.getName().endsWith(".png") || !photo.getName().endsWith("jpeg"))
310+
if (!photo.getName().endsWith(".jpg") && !photo.getName().endsWith(".png") && !photo.getName().endsWith("jpeg"))
311311
throw new InstagramException("Unsupported file format. Only photos with jpg/png/jpeg extensions are allowed", Reasons.UNSUPPORTED_FILE_FORMAT);
312312

313313
return AsyncTask.callAsync(() -> {

0 commit comments

Comments
 (0)