Skip to content

Commit 838755c

Browse files
authored
Merge pull request #40 from bugsnag/fix-manual-notify
Send logType safely
2 parents bec060b + b0248f7 commit 838755c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Bugsnag.unitypackage

-3.16 KB
Binary file not shown.

example/Assets/Standard Assets/Bugsnag/Bugsnag.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public static void Notify(string errorClass, string errorMessage, string severit
136136
IntPtr addToTabMethodId = AndroidJNI.GetMethodID(metaData.GetRawClass(), "addToTab", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V");
137137
AndroidJNI.CallVoidMethod(metaData.GetRawObject(), addToTabMethodId, args);
138138

139-
if (type != null) {
139+
if (!String.IsNullOrEmpty(type)) {
140140
// Add unity log level
141141
args = new jvalue[3] {
142142
new jvalue() { l = AndroidJNI.NewStringUTF("Unity") },
@@ -603,7 +603,7 @@ private static void NotifySafely(string errorClass, string message, Severity sev
603603
return;
604604
}
605605

606-
string logType = null;
606+
string logType = "";
607607
if (type != null) {
608608
logType = type.ToString();
609609
}

src/Assets/Standard Assets/Bugsnag/Bugsnag.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public static void Notify(string errorClass, string errorMessage, string severit
136136
IntPtr addToTabMethodId = AndroidJNI.GetMethodID(metaData.GetRawClass(), "addToTab", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V");
137137
AndroidJNI.CallVoidMethod(metaData.GetRawObject(), addToTabMethodId, args);
138138

139-
if (type != null) {
139+
if (!String.IsNullOrEmpty(type)) {
140140
// Add unity log level
141141
args = new jvalue[3] {
142142
new jvalue() { l = AndroidJNI.NewStringUTF("Unity") },
@@ -603,7 +603,7 @@ private static void NotifySafely(string errorClass, string message, Severity sev
603603
return;
604604
}
605605

606-
string logType = null;
606+
string logType = "";
607607
if (type != null) {
608608
logType = type.ToString();
609609
}

0 commit comments

Comments
 (0)