Skip to content

Commit 79dc52a

Browse files
author
Aman
committed
Fix NullPointerException when context is null.
1 parent 94a8a32 commit 79dc52a

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hyperlog/gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Tue Jan 30 12:15:30 IST 2018
1+
#Tue Jan 30 18:40:51 IST 2018
22
version=0.0.8
3-
VERSION_BUILD=385
4-
VERSION_PATCH=8
3+
VERSION_BUILD=387
4+
VERSION_PATCH=8

hyperlog/src/main/java/com/hypertrack/hyperlog/HyperLog.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ public static void initialize(@NonNull Context context, int expiryTimeInSeconds)
109109
public static void initialize(@NonNull Context context, int expiryTimeInSeconds,
110110
@NonNull LogFormat logFormat) {
111111

112-
if (context == null)
112+
if (context == null) {
113113
Log.e(TAG, "HyperLog isn't initialized: Context couldn't be null");
114+
return;
115+
}
114116

115117
HyperLog.context = context.getApplicationContext();
116118

@@ -290,7 +292,6 @@ private static String getMethodName() {
290292
return e.getMethodName();
291293
}
292294

293-
294295
private static void r(final String message) {
295296
try {
296297

@@ -619,7 +620,7 @@ public static void pushLogs(Context mContext, String fileName, HashMap<String,
619620
return;
620621

621622
if (TextUtils.isEmpty(URL)) {
622-
HyperLog.e(TAG,"API endpoint URL is missing. Set URL using " +
623+
HyperLog.e(TAG, "API endpoint URL is missing. Set URL using " +
623624
"HyperLog.setURL method");
624625
return;
625626
}
@@ -679,7 +680,7 @@ public void onErrorResponse(VolleyError error) {
679680
temp[0]--;
680681
error.printStackTrace();
681682
HyperLog.exception(TAG, "Error has occurred while pushing " +
682-
"logs: ", error);
683+
"logs: ", error);
683684

684685
if (temp[0] == 0) {
685686
if (callback != null) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy