[LinphoneUtils] quick fix getExtensionFileFromPath() to avoid crash
This commit is contained in:
parent
b1a041a792
commit
6345f5202c
1 changed files with 3 additions and 3 deletions
|
@ -489,7 +489,6 @@ public final class LinphoneUtils {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String getExtensionFromFileName(String fileName) {
|
public static String getExtensionFromFileName(String fileName) {
|
||||||
String extension = null;
|
String extension = null;
|
||||||
int i = fileName.lastIndexOf('.');
|
int i = fileName.lastIndexOf('.');
|
||||||
|
@ -500,7 +499,9 @@ public final class LinphoneUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Boolean isExtensionImage(String path){
|
public static Boolean isExtensionImage(String path){
|
||||||
String extension = LinphoneUtils.getExtensionFromFileName(path).toLowerCase();
|
String extension = LinphoneUtils.getExtensionFromFileName(path);
|
||||||
|
if(extension != null)
|
||||||
|
extension = extension.toLowerCase();
|
||||||
return (extension != null && extension.matches(".*(png|jpg|jpeg|bmp|gif).*"));
|
return (extension != null && extension.matches(".*(png|jpg|jpeg|bmp|gif).*"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -627,7 +628,6 @@ public final class LinphoneUtils {
|
||||||
if (LinphoneAccountCreator.PhoneNumberCheck.Invalid.value()
|
if (LinphoneAccountCreator.PhoneNumberCheck.Invalid.value()
|
||||||
== (status & LinphoneAccountCreator.PhoneNumberCheck.Invalid.value()))
|
== (status & LinphoneAccountCreator.PhoneNumberCheck.Invalid.value()))
|
||||||
return ctxt.getString(R.string.phone_number_invalid);
|
return ctxt.getString(R.string.phone_number_invalid);
|
||||||
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue