Skip to content

Commit 77ac40f

Browse files
committed
Prevent users from dereferencing null pointers accidentally
1 parent 12e4b91 commit 77ac40f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/BaseClasses/ANTPLUS_BaseProfile.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,14 @@ void BaseProfile::loop() {
143143
}
144144

145145
void BaseProfile::begin() {
146+
if (!_router)
147+
return;
146148
pushChannelConfig();
147149
openChannel();
148150
}
149151

150152
void BaseProfile::stop() {
153+
if (!_router)
154+
return;
151155
closeChannel();
152156
}

0 commit comments

Comments
 (0)