Created
March 5, 2014 20:42
-
-
Save brendanzagaeski/9376167 to your computer and use it in GitHub Desktop.
Patch to prevent NullReferenceException in AndHUD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/AndHUD/AndHUD.cs b/AndHUD/AndHUD.cs | |
index 2022fcb..6d57870 100644 | |
--- a/AndHUD/AndHUD.cs | |
+++ b/AndHUD/AndHUD.cs | |
@@ -222,10 +222,12 @@ namespace AndroidHUD | |
} | |
else | |
{ | |
- Application.SynchronizationContext.Post(state => { | |
- progressWheel.SetProgress (progress); | |
- statusText.Text = status ?? ""; | |
- }, null); | |
+ if (progressWheel != null) { | |
+ Application.SynchronizationContext.Post(state => { | |
+ progressWheel.SetProgress (progress); | |
+ statusText.Text = status ?? ""; | |
+ }, null); | |
+ } | |
} | |
} | |
} | |
@@ -283,10 +285,12 @@ namespace AndroidHUD | |
} | |
else | |
{ | |
- Application.SynchronizationContext.Post(state => { | |
- imageView.SetImageDrawable(image); | |
- statusText.Text = status ?? ""; | |
- }, null); | |
+ if (imageView != null) { | |
+ Application.SynchronizationContext.Post(state => { | |
+ imageView.SetImageDrawable(image); | |
+ statusText.Text = status ?? ""; | |
+ }, null); | |
+ } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment