diff options
| author | lempamo <[email protected]> | 2017-02-28 12:27:16 -0500 |
|---|---|---|
| committer | lempamo <[email protected]> | 2017-02-28 12:27:16 -0500 |
| commit | dd95bc225f332c3c8ad23db55b3600b75e9511f1 (patch) | |
| tree | e8b779f598f271c0e0db294a141e5316a82e824b /ShiftOS.WinForms/Applications | |
| parent | 8656337c5dc64bea29f330a51b362f0a6b85ef78 (diff) | |
| download | shiftos_thereturn-dd95bc225f332c3c8ad23db55b3600b75e9511f1.tar.gz shiftos_thereturn-dd95bc225f332c3c8ad23db55b3600b75e9511f1.tar.bz2 shiftos_thereturn-dd95bc225f332c3c8ad23db55b3600b75e9511f1.zip | |
found a NRE
Diffstat (limited to 'ShiftOS.WinForms/Applications')
| -rw-r--r-- | ShiftOS.WinForms/Applications/Snakey.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ShiftOS.WinForms/Applications/Snakey.cs b/ShiftOS.WinForms/Applications/Snakey.cs index f210c9c..2f01b88 100644 --- a/ShiftOS.WinForms/Applications/Snakey.cs +++ b/ShiftOS.WinForms/Applications/Snakey.cs @@ -51,7 +51,9 @@ namespace ShiftOS.WinForms.Applications } } - int headX = int.Parse(head.Name.Split('b')[1]); + if (head == null) return; + + int headX = int.Parse(head.Name.Split('b')[1]); // NRE was here int headY = int.Parse(head.Name.Split('b')[2]); int newHeadX = headX; @@ -157,14 +159,14 @@ namespace ShiftOS.WinForms.Applications } snakemap = new int[10, 10]; snakemap[5, 5] = 2; - tableLayoutPanel1.GetControlFromPosition(5, 5).BackgroundImage = Properties.Resources.SnakeyHeadL; + ((PictureBox)tableLayoutPanel1.GetControlFromPosition(5, 5)).Image = Properties.Resources.SnakeyHeadL; for (int x = 6; x < 8; x++) { snakemap[x, 5] = 1; - tableLayoutPanel1.GetControlFromPosition(x, 5).BackgroundImage = Properties.Resources.SnakeyBody; + ((PictureBox)tableLayoutPanel1.GetControlFromPosition(x, 5)).Image = Properties.Resources.SnakeyBody; } snakemap[8, 5] = 3; - tableLayoutPanel1.GetControlFromPosition(8, 5).BackgroundImage = Properties.Resources.SnakeyTailL; + ((PictureBox)tableLayoutPanel1.GetControlFromPosition(8, 5)).Image = Properties.Resources.SnakeyTailL; snakeupdater.Start(); } |
