File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -1046,12 +1046,17 @@ CHIP_ERROR FabricTable::Delete(FabricIndex fabricIndex)
1046
1046
}
1047
1047
}
1048
1048
1049
- // Only return error after trying really hard to remove everything we could
1050
- ReturnErrorOnFailure (metadataErr);
1051
- ReturnErrorOnFailure (opKeyErr);
1052
- ReturnErrorOnFailure (opCertsErr);
1049
+ if (fabricIsInitialized)
1050
+ {
1051
+ // Only return error after trying really hard to remove everything we could
1052
+ ReturnErrorOnFailure (metadataErr);
1053
+ ReturnErrorOnFailure (opKeyErr);
1054
+ ReturnErrorOnFailure (opCertsErr);
1053
1055
1054
- return CHIP_NO_ERROR;
1056
+ return CHIP_NO_ERROR;
1057
+ }
1058
+
1059
+ return CHIP_ERROR_NOT_FOUND;
1055
1060
}
1056
1061
1057
1062
void FabricTable::DeleteAllFabrics ()
Original file line number Diff line number Diff line change @@ -417,6 +417,7 @@ class DLL_EXPORT FabricTable
417
417
*
418
418
* @param fabricIndex - Index of fabric for deletion
419
419
* @retval CHIP_NO_ERROR on success
420
+ * @retval CHIP_ERROR_NOT_FOUND if there is no fabric for that index
420
421
* @retval CHIP_ERROR_INVALID_ARGUMENT if any of the arguments are invalid such as too large or out of bounds
421
422
* @retval other CHIP_ERROR on internal errors
422
423
*/
You can’t perform that action at this time.
0 commit comments