diff options
author | Debian CLI Applications Team <pkg-cli-apps-team@lists.alioth.debian.org> | 2017-05-24 21:06:47 +0100 |
---|---|---|
committer | Andreas Moog <andreas.moog@warperbbs.de> | 2017-05-24 21:06:47 +0100 |
commit | 02619d863337218191a2f68dea459dd6b0e88f33 (patch) | |
tree | 0321c96b05b9028dee61e9f39e9d1f18fbded3b6 | |
parent | 456a6f9bac514de396aa73d4e2cbda8740cd8698 (diff) |
nvidia_crash
===================================================================
Gbp-Pq: Name 07-nvidia_crash.diff
-rw-r--r-- | Sysinfo/NvidiaInfo.cs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/Sysinfo/NvidiaInfo.cs b/Sysinfo/NvidiaInfo.cs index 7707ca6..e7c07fe 100644 --- a/Sysinfo/NvidiaInfo.cs +++ b/Sysinfo/NvidiaInfo.cs @@ -118,8 +118,11 @@ namespace Sysinfo { temp = proc1.StandardOutput.ReadLine(); temp = proc1.StandardOutput.ReadLine(); - temp = temp.Remove(0, temp.LastIndexOf(":") + 2); - nvidia_videoram = ( Double.Parse(temp) / 1024 ).ToString() + " MB"; + + if (temp != null) { + temp = temp.Remove(0, temp.LastIndexOf(":") + 2); + nvidia_videoram = ( Double.Parse(temp) / 1024 ).ToString() + " MB"; + } proc1.Close(); @@ -135,8 +138,10 @@ namespace Sysinfo { temp = proc2.StandardOutput.ReadLine(); temp = proc2.StandardOutput.ReadLine(); - temp = temp.Remove(0, temp.LastIndexOf(":") + 2); - nvidia_busrate = temp.Remove(temp.LastIndexOf("."), 1) + "x"; + if (temp != null) { + temp = temp.Remove(0, temp.LastIndexOf(":") + 2); + nvidia_busrate = temp.Remove(temp.LastIndexOf("."), 1) + "x"; + } proc2.Close(); @@ -151,9 +156,11 @@ namespace Sysinfo { temp = proc3.StandardOutput.ReadLine(); temp = proc3.StandardOutput.ReadLine(); - - temp = temp.Remove(0, temp.LastIndexOf(":") + 2); - nvidia_gpu = temp.Remove(temp.LastIndexOf(","), 5) + " MHz"; + + if (temp != null) { + temp = temp.Remove(0, temp.LastIndexOf(":") + 2); + nvidia_gpu = temp.Remove(temp.LastIndexOf(","), 5) + " MHz"; + } proc3.Close(); |