Skip to content

Commit 99138f9

Browse files
authored
Make local.properties optional (#54)
1 parent bbc2975 commit 99138f9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

example-app/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ android {
3939
}
4040

4141
String getSubmissionUrl() {
42-
def propFile = rootProject.file("./local.properties")
42+
if (!rootProject.file("./local.properties").exists()) {
43+
return "null"
44+
}
4345
def properties = new Properties()
44-
properties.load(new FileInputStream(propFile))
45-
return properties.containsKey('BACKTRACE_SUBMISSION_URL') ? properties['BACKTRACE_SUBMISSION_URL'] : "null"
46+
properties.load(rootProject.file("./local.properties").newDataInputStream())
47+
return properties.containsKey('BACKTRACE_SUBMISSION_URL') ? properties['BACKTRACE_SUBMISSION_URL'] : "null"
4648
}
4749

4850
dependencies {

0 commit comments

Comments
 (0)