Unverified Commit 4ab0ba61 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Fix crash on SD.end() without initial SD.begin() (#2222)

Fixes #2220
parent eb0badd8
...@@ -43,8 +43,9 @@ public: ...@@ -43,8 +43,9 @@ public:
void end(bool endSPI = true) { void end(bool endSPI = true) {
SDFS.end(); SDFS.end();
if (endSPI) { if (endSPI && _spi) {
_spi->end(); _spi->end();
_spi = nullptr;
} }
} }
...@@ -205,7 +206,7 @@ private: ...@@ -205,7 +206,7 @@ private:
return time(nullptr); return time(nullptr);
} }
HardwareSPI *_spi; HardwareSPI *_spi = nullptr;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment