Skip to content

Commit

Permalink
fix crash upload file when name file is 3 char
Browse files Browse the repository at this point in the history
  • Loading branch information
Arief Nur Putranto committed Dec 16, 2021
1 parent ea2c6a7 commit e96caae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ public static File from(Uri uri) throws IOException {
InputStream inputStream = QiscusCore.getApps().getContentResolver().openInputStream(uri);
String fileName = getFileName(uri);
String[] splitName = splitFileName(fileName);
File tempFile = File.createTempFile(splitName[0], splitName[1]);
String tempName = "temp";
File tempFile;
if (splitName[0].length() < 4){
tempFile = File.createTempFile(tempName, splitName[1]);
} else {
tempFile = File.createTempFile(splitName[0], splitName[1]);
}
tempFile = rename(tempFile, fileName);
tempFile.deleteOnExit();
FileOutputStream out = null;
Expand Down
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ext {

nirmana : "1.3.0",
manggil : "1.0.1",
jupuk : "1.5.0",
jupuk : "1.5.2",

rxJava : "1.3.4",
rxAndroid : "1.2.1",
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
# === qiscus chat library version ===
chatVersionMajor=2
chatVersionMinor=31
chatVersionPatch=1
chatVersionPatch=2

# === qiscus chat-core library version ===
chatCoreVersionMajor=1
chatCoreVersionMinor=3
chatCoreVersionPatch=35
chatCoreVersionPatch=36

# === qiscus default base url
BASE_URL_SERVER="https://api.qiscus.com/"
Expand All @@ -57,8 +57,8 @@ android.enableR8=true

libraryGroupId=com.qiscus.sdk
libraryArtifactId=chat-core
libraryVersion=1.3.35
libraryVersion=1.3.36

libraryGroupIdChat=com.qiscus.sdk
libraryArtifactIdChat=chat
libraryVersionChat=2.31.1
libraryVersionChat=2.31.2

0 comments on commit e96caae

Please sign in to comment.