Skip to content

Commit

Permalink
Merge pull request #26 from styleseller-co-kr/bug/fix_checking_image_…
Browse files Browse the repository at this point in the history
…extension

[MOD] fixed bug, checking image extension for sending image messages
  • Loading branch information
ErrorxCode authored Aug 5, 2023
2 parents 76fb0c8 + ddbf5ab commit d87bd34
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public AsyncTask<Void> directMessage(@NotNull String username, @NotNull String m
* @return A {@link AsyncTask} indication success or failure of the request
*/
public AsyncTask<Void> directMessage(@NotNull String username, @NotNull File photo) {
if (!photo.getName().endsWith(".jpg") || !photo.getName().endsWith(".png") || !photo.getName().endsWith("jpeg"))
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);

return AsyncTask.callAsync(() -> {
Expand Down

0 comments on commit d87bd34

Please sign in to comment.