h4yn0nnym0u5e
Well-known member
No. As stated by @thebigg , the FS filesystem class has an implementation of theThe test eliminates the null-pointer crashes that used to occur. Wouldhave been more correct?Code:if (SnapshotFile == null)
bool operator that shows you if the SnapshotFile has a valid open file. Your test is correct as you wrote it.As an aside, my preferred test for a null pointer is something like
C++:
if (nullptr == mightBeNULLptr)
nullptr tells the compiler more about what you’re doing, and the apparently clunky / backwards check means that if you accidentally type = you get a full-blown error.I can’t see any evidence to suggest it, but just checking you’re not accessing the SD card from inside an ISR? That almost always ends badly…