File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
api/src/main/java/com/messagebird Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -257,11 +257,13 @@ private synchronized static void allowPatchRequestsIfNeeded() throws GeneralExce
257
257
modifiersField .setAccessible (true );
258
258
modifiersField .setInt (methodsField , methodsField .getModifiers () & ~Modifier .FINAL );
259
259
260
+ Object noInstanceBecauseStaticField = null ;
261
+
260
262
// Determine what methods should be allowed.
261
- String [] allowedMethods = getAllowedMethods ((String []) methodsField .get (null ));
263
+ String [] existingMethods = (String []) methodsField .get (noInstanceBecauseStaticField );
264
+ String [] allowedMethods = getAllowedMethods (existingMethods );
262
265
263
266
// Override the actual field to allow PATCH.
264
- Object noInstanceBecauseStaticField = null ;
265
267
methodsField .set (noInstanceBecauseStaticField , allowedMethods );
266
268
267
269
// Set flag so we only have to run this once.
You can’t perform that action at this time.
0 commit comments