File tree 4 files changed +9
-5
lines changed 4 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,11 @@ const Flagsmith = class {
85
85
isFetching : true
86
86
} )
87
87
}
88
- const handleResponse = ( { flags : features , traits } : IFlagsmithResponse ) => {
88
+ const handleResponse = ( response : IFlagsmithResponse | null ) => {
89
+ if ( ! response ) {
90
+ return // getJSON returned null due to request/response mismatch
91
+ }
92
+ let { flags : features , traits } : IFlagsmithResponse = response
89
93
this . isLoading = false ;
90
94
if ( identity ) {
91
95
this . withTraits = null ;
@@ -188,7 +192,7 @@ const Flagsmith = class {
188
192
] )
189
193
. then ( ( res ) => {
190
194
this . withTraits = null
191
- return handleResponse ( res [ 0 ] as IFlagsmithResponse )
195
+ return handleResponse ( res ?. [ 0 ] as IFlagsmithResponse | null )
192
196
} ) . catch ( ( { message } ) => {
193
197
const error = new Error ( message )
194
198
return Promise . reject ( error )
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " flagsmith-es" ,
3
- "version" : " 4.0.2 " ,
3
+ "version" : " 4.0.3 " ,
4
4
"description" : " Feature flagging to support continuous development. This is an esm equivalent of the standard flagsmith npm module." ,
5
5
"main" : " ./index.js" ,
6
6
"type" : " module" ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " flagsmith" ,
3
- "version" : " 4.0.2 " ,
3
+ "version" : " 4.0.3 " ,
4
4
"description" : " Feature flagging to support continuous development" ,
5
5
"main" : " ./index.js" ,
6
6
"repository" : {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-native-flagsmith" ,
3
- "version" : " 4.0.2 " ,
3
+ "version" : " 4.0.3 " ,
4
4
"description" : " Feature flagging to support continuous development" ,
5
5
"main" : " ./index.js" ,
6
6
"repository" : {
You can’t perform that action at this time.
0 commit comments